2005-10-18 00:39:58 +04:00
|
|
|
PROJECT(MathTest)
|
|
|
|
|
|
|
|
|
|
|
|
# Expression test
|
|
|
|
|
|
|
|
SET(expressions
|
|
|
|
"5 * ( 3 + 4)"
|
|
|
|
"(1 | 2 | 4 | 8) & 16"
|
2005-10-18 21:22:28 +04:00
|
|
|
"1 +(3*4) + 10 >> 2"
|
|
|
|
"10000 / 20 / 4"
|
|
|
|
"10000 / (20 / 4)"
|
2005-10-18 00:39:58 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
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}")
|
2007-05-11 18:22:20 +04:00
|
|
|
ADD_EXECUTABLE(MathTest MathTestExec.cxx)
|
2005-10-18 00:39:58 +04:00
|
|
|
|