summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/math
diff options
context:
space:
mode:
authorDaniel Franke <franke@edf-online.de>2018-05-18 19:59:46 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-22 13:00:34 (GMT)
commit963b8d9f6c1c4bcce2a82ade137a82b17ef75780 (patch)
tree72d7dec8428859772274523a9b22d0564a1c00c7 /Tests/RunCMake/math
parent575f97763f08f0358cb5ccb4ac937d1610cbbbf7 (diff)
downloadCMake-963b8d9f6c1c4bcce2a82ade137a82b17ef75780.zip
CMake-963b8d9f6c1c4bcce2a82ade137a82b17ef75780.tar.gz
CMake-963b8d9f6c1c4bcce2a82ade137a82b17ef75780.tar.bz2
math: Add RunCMake.math test to prepare for error cases
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 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)