summaryrefslogtreecommitdiff
path: root/Tests/MathTest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/MathTest/CMakeLists.txt')
-rw-r--r--Tests/MathTest/CMakeLists.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt
new file mode 100644
index 000000000..d1e5b1acd
--- /dev/null
+++ b/Tests/MathTest/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(MathTest)
+
+
+# Expression test
+
+SET(expressions
+ "5 * ( 3 + 4)"
+ "(1 | 2 | 4 | 8) & 16"
+ "1 +(3*4) + 10 >> 2"
+ "10000 / 20 / 4"
+ "10000 / (20 / 4)"
+ )
+
+SET(FILE_EXPRESSIONS "")
+FOREACH(expression
+ ${expressions})
+ MATH(EXPR expr "${expression}")
+ SET(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
+ENDFOREACH(expression)
+
+CONFIGURE_FILE(
+ "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h"
+ @ONLY)
+
+INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
+ADD_EXECUTABLE(MathTest MathTestExec.cxx)
+