From da7155f5bc70440ccb1238e73194c2a454442f8d Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 15 Dec 2014 16:44:59 -0500 Subject: [PATCH 1/3] Tests: Allow RunCMake tests to pass generator expressions --- Tests/RunCMake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 2bfd4d6e3..4ec8feb36 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -1,7 +1,7 @@ # See adjacent README.rst for documentation of this test infrastructure. macro(add_RunCMake_test test) - add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND} + 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} From a85ee8b8cf4fb4be5f5ebd6e88e2753d1ec654ae Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 15 Dec 2014 16:46:05 -0500 Subject: [PATCH 2/3] Tests: Simplify RunCMake test extra argument passing Allow add_RunCMake_test calls to pass non-optional arguments immediately. --- Tests/RunCMake/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 4ec8feb36..e74eadde1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -9,6 +9,7 @@ macro(add_RunCMake_test test) -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} ${${test}_ARGS} + ${ARGN} -P "${CMAKE_CURRENT_SOURCE_DIR}/${test}/RunCMakeTest.cmake" ) endmacro() @@ -131,8 +132,7 @@ if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) add_RunCMake_test(IncompatibleQt) endif() if (QT4_FOUND) - set(ObsoleteQtMacros_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) - add_RunCMake_test(ObsoleteQtMacros) + add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) endif() find_package(PkgConfig QUIET) From 29533380ea887e3f5eab44260bbd77933cf91ca9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Dec 2014 13:33:47 -0500 Subject: [PATCH 3/3] Tests: Allow RunCMake expected result code to be a regex This will allow the '-result.txt' files to specify a regex matching different results on different platforms. --- Tests/RunCMake/RunCMake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 56d69c846..7b1a5b2a8 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -65,7 +65,7 @@ function(run_cmake test) ) endif() set(msg "") - if(NOT "${actual_result}" STREQUAL "${expect_result}") + if(NOT "${actual_result}" MATCHES "${expect_result}") set(msg "${msg}Result is [${actual_result}], not [${expect_result}].\n") endif() foreach(o out err)