From d958105afb92938941216a33fb51578c834a8521 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Jul 2009 16:57:38 -0400 Subject: [PATCH] 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. --- Tests/CMakeTests/VariableWatchTest.cmake.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index 0caeeb073..bdb4f7ec4 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)