summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/math
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/math')
-rw-r--r--Tests/RunCMake/math/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/math/MATH.cmake9
-rw-r--r--Tests/RunCMake/math/RunCMakeTest.cmake3
3 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/math/CMakeLists.txt b/Tests/RunCMake/math/CMakeLists.txt
new file mode 100644
index 0000000000..12cd3c7757
--- /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 0000000000..4ec7f9c57f
--- /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 0000000000..7098f67cbb
--- /dev/null
+++ b/Tests/RunCMake/math/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(MATH)