summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt3
-rw-r--r--Tests/CMakeTests/VariableWatchTest.cmake.in22
2 files changed, 24 insertions, 1 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index a1eefb5..6f5167f 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -4,7 +4,8 @@ SET(CMAKE_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/cmake")
MACRO(AddCMakeTest TestName Arguments)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
- ADD_TEST(CMake.List ${CMAKE_EXECUTABLE} -P "${CMAKE_CURRENT_BINARY_DIR}/ListTest.cmake" ${Arguments})
+ ADD_TEST(CMake.${TestName} ${CMAKE_EXECUTABLE} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${Arguments})
ENDMACRO(AddCMakeTest)
AddCMakeTest(List "")
+AddCMakeTest(VariableWatch "")
diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in
new file mode 100644
index 0000000..0caeeb0
--- /dev/null
+++ b/Tests/CMakeTests/VariableWatchTest.cmake.in
@@ -0,0 +1,22 @@
+MESSAGE("Start")
+
+VARIABLE_WATCH(TESTVAR MESSAGE)
+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}")
+endmacro(testwatch)
+
+VARIABLE_WATCH(somevar testwatch)
+
+set(TESTVAR1 "1")
+set(TESTVAR "1")
+set(TESTVAR1 "0")
+set(TESTVAR "0")
+
+
+message("Variable: ${somevar}")
+set(somevar "1")
+message("Variable: ${somevar}")
+remove(somevar)