mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 14:01:21 +00:00
math: Add RunCMake.math test to prepare for error cases
This commit is contained in:
parent
575f97763f
commit
963b8d9f6c
@ -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)
|
||||
|
3
Tests/RunCMake/math/CMakeLists.txt
Normal file
3
Tests/RunCMake/math/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8.4)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
9
Tests/RunCMake/math/MATH.cmake
Normal file
9
Tests/RunCMake/math/MATH.cmake
Normal file
@ -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)
|
3
Tests/RunCMake/math/RunCMakeTest.cmake
Normal file
3
Tests/RunCMake/math/RunCMakeTest.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(MATH)
|
Loading…
Reference in New Issue
Block a user