Merge topic 'test-RunCMake-updates'

c0d8e715 RunCMake: Allow specifying the stderr file for a test.
68d29f51 RunCMake: Allow specifying the directory to run tests in.
1c3918ff RunCMake: Remove unneeded files.
This commit is contained in:
Brad King 2015-02-10 10:09:47 -05:00 committed by CMake Topic Stage
commit 2fd44b082b
59 changed files with 18 additions and 61 deletions

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -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()

View File

@ -18,7 +18,10 @@ function(run_cmake test)
set(expect_result 0)
endif()
foreach(o out err)
if(EXISTS ${top_src}/${test}-std${o}.txt)
if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file})
file(READ ${top_src}/${RunCMake-std${o}-file} expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
elseif(EXISTS ${top_src}/${test}-std${o}.txt)
file(READ ${top_src}/${test}-std${o}.txt expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
else()

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$

View File

@ -1 +0,0 @@
^$