diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/math/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/math/MATH.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/math/RunCMakeTest.cmake | 3 |
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index daf3940..bd7626a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -238,6 +238,7 @@ add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(include_guard) add_RunCMake_test(list) +add_RunCMake_test(math) add_RunCMake_test(message) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) add_RunCMake_test(return) diff --git a/Tests/RunCMake/math/CMakeLists.txt b/Tests/RunCMake/math/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/math/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/math/MATH.cmake b/Tests/RunCMake/math/MATH.cmake new file mode 100644 index 0000000..4ec7f9c --- /dev/null +++ b/Tests/RunCMake/math/MATH.cmake @@ -0,0 +1,9 @@ +macro(math_test expression expected) + math(EXPR evaluated ${expression} ${ARGN}) + if (NOT evaluated STREQUAL ${expected}) + message(FATAL_ERROR "wrong math result: ${evaluated} != ${expected}") + endif () +endmacro() + + +math_test("100 * 10" 1000) diff --git a/Tests/RunCMake/math/RunCMakeTest.cmake b/Tests/RunCMake/math/RunCMakeTest.cmake new file mode 100644 index 0000000..7098f67 --- /dev/null +++ b/Tests/RunCMake/math/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(MATH) |