summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-09 07:39:18 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-09 18:15:04 (GMT)
commit68d29f519047aeef92a0ab8fef531010c311efaa (patch)
tree0e0087b90814f4b3dead585bb4053860f2628e94
parent1c3918ff0278715e2a4ec5929f75f7812003ee97 (diff)
downloadCMake-68d29f519047aeef92a0ab8fef531010c311efaa.zip
CMake-68d29f519047aeef92a0ab8fef531010c311efaa.tar.gz
CMake-68d29f519047aeef92a0ab8fef531010c311efaa.tar.bz2
RunCMake: Allow specifying the directory to run tests in.
-rw-r--r--Tests/RunCMake/CMakeLists.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 801655f..2973fe9 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -1,17 +1,28 @@
# See adjacent README.rst for documentation of this test infrastructure.
macro(add_RunCMake_test test)
+ set(TEST_ARGS ${ARGN})
+ if ("${ARGV1}" STREQUAL "TEST_DIR")
+ if ("${ARGV2}" STREQUAL "")
+ message(FATAL_ERROR "Invalid args")
+ endif()
+ set(Test_Dir ${ARGV2})
+ list(REMOVE_AT TEST_ARGS 0)
+ list(REMOVE_AT TEST_ARGS 0)
+ else()
+ set(Test_Dir ${test})
+ endif()
add_test(NAME RunCMake.${test} COMMAND ${CMAKE_CMAKE_COMMAND}
-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
-DRunCMake_GENERATOR=${CMAKE_GENERATOR}
-DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
-DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
- -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test}
+ -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${Test_Dir}
-DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test}
${${test}_ARGS}
- ${ARGN}
- -P "${CMAKE_CURRENT_SOURCE_DIR}/${test}/RunCMakeTest.cmake"
+ ${TEST_ARGS}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/${Test_Dir}/RunCMakeTest.cmake"
)
endmacro()