summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-24 20:57:38 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-24 20:57:38 (GMT)
commitd958105afb92938941216a33fb51578c834a8521 (patch)
tree8a2758147b4166577c94df617dc2ef9022066a69 /Tests
parent3e5543c8bcfd6f67b9fe6759c6a32da23a629b85 (diff)
downloadCMake-d958105afb92938941216a33fb51578c834a8521.zip
CMake-d958105afb92938941216a33fb51578c834a8521.tar.gz
CMake-d958105afb92938941216a33fb51578c834a8521.tar.bz2
BUG: Teach VariableWatch test to check results
Previously this test was only a smoke test for manual verification. This teaches the test to actually check that the variable watch succeeds.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeTests/VariableWatchTest.cmake.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in
index 0caeeb0..bdb4f7e 100644
--- a/Tests/CMakeTests/VariableWatchTest.cmake.in
+++ b/Tests/CMakeTests/VariableWatchTest.cmake.in
@@ -6,6 +6,7 @@ VARIABLE_WATCH(TESTVAR1)
macro(testwatch var access file stack)
MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}")
MESSAGE("List file stack is: ${stack}")
+ set(${var}_watched 1)
endmacro(testwatch)
VARIABLE_WATCH(somevar testwatch)
@@ -17,6 +18,14 @@ set(TESTVAR "0")
message("Variable: ${somevar}")
+if(NOT somevar_watched)
+ message(SEND_ERROR "'somevar' watch failed!")
+endif()
+set(somevar_watched)
+
set(somevar "1")
message("Variable: ${somevar}")
+if(NOT somevar_watched)
+ message(SEND_ERROR "'somevar' watch failed!")
+endif()
remove(somevar)