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.
This commit is contained in:
parent
3e5543c8bc
commit
d958105afb
|
@ -6,6 +6,7 @@ VARIABLE_WATCH(TESTVAR1)
|
||||||
macro(testwatch var access file stack)
|
macro(testwatch var access file stack)
|
||||||
MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}")
|
MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}")
|
||||||
MESSAGE("List file stack is: ${stack}")
|
MESSAGE("List file stack is: ${stack}")
|
||||||
|
set(${var}_watched 1)
|
||||||
endmacro(testwatch)
|
endmacro(testwatch)
|
||||||
|
|
||||||
VARIABLE_WATCH(somevar testwatch)
|
VARIABLE_WATCH(somevar testwatch)
|
||||||
|
@ -17,6 +18,14 @@ set(TESTVAR "0")
|
||||||
|
|
||||||
|
|
||||||
message("Variable: ${somevar}")
|
message("Variable: ${somevar}")
|
||||||
|
if(NOT somevar_watched)
|
||||||
|
message(SEND_ERROR "'somevar' watch failed!")
|
||||||
|
endif()
|
||||||
|
set(somevar_watched)
|
||||||
|
|
||||||
set(somevar "1")
|
set(somevar "1")
|
||||||
message("Variable: ${somevar}")
|
message("Variable: ${somevar}")
|
||||||
|
if(NOT somevar_watched)
|
||||||
|
message(SEND_ERROR "'somevar' watch failed!")
|
||||||
|
endif()
|
||||||
remove(somevar)
|
remove(somevar)
|
||||||
|
|
Loading…
Reference in New Issue