diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 104 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/UsesTerminal-check.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/UsesTerminal.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/GoogleTest/fake_gtest.cpp | 1 |
6 files changed, 23 insertions, 112 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index da6219e..6946ffb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2107,109 +2107,7 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") endif() - if(NOT DEFINED CTEST_RUN_MFC) - set(CTEST_RUN_MFC OFF) - - if(MSVC) - set(CTEST_RUN_MFC ON) - - # Look for evidence that this is a VCExpress build. If so, avoid - # the MFC test by default. - string(TOLOWER "${CMAKE_MAKE_PROGRAM}" mkprog) - if(mkprog MATCHES "vcexpress") - message(STATUS - "CMAKE_MAKE_PROGRAM indicates vcexpress, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - endif() - - # Since MSBuild might also be the "makeprogram" for a VCExpress - # build tree, use one more heuristic, too. The string representing - # the .vcproj file type contains "VCExpress" on machines where an - # express edition of VS was installed last: - if(CTEST_RUN_MFC) - execute_process(COMMAND cmd /c assoc .vcproj - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE ov) - if(ov MATCHES "VCExpress") - message(STATUS - ".vcproj file association indicates VCExpress, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - elseif( NOT ov ) - message(STATUS - ".vcproj has no file association, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - endif() - endif() - - if(CTEST_RUN_MFC) - # For the Watcom WMake generator, avoid the MFC test by default. - if("${CMAKE_GENERATOR}" MATCHES "WMake") - message(STATUS - "using the Watcom WMake generator, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM") - # clang-cl cannot deal with implicit dependencies in UTF16 files - # (see #18311). IntelLLVM inherits this behavior from Clang. - # TODO: maybe clang should also skip the MFC test - message(STATUS - "using generator other than Visual Studio with clang-cl, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - endif() - endif() - - # Last resort, after quick checks are done. Do a try_compile, and avoid - # the MFC test if the simplest possible MFC app cannot be compiled. - if(CTEST_RUN_MFC AND NOT DEFINED HAVE_MFC) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/MFC/try_compile/CMakeLists.txt - ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/CMakeLists.txt - COPYONLY - ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/MFC/mfc1/stdafx.cpp - ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/stdafx.cpp - COPYONLY - ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/MFC/mfc1/stdafx.h - ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/stdafx.h - COPYONLY - ) - - message(STATUS "Looking for MFC") - - try_compile(HAVE_MFC - ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/build - ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile - try_compile_mfc - OUTPUT_VARIABLE HAVE_MFC_OUTPUT) - - if(HAVE_MFC) - message(STATUS "Looking for MFC - found") - set(HAVE_MFC 1 CACHE INTERNAL "Have MFC") - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if MFC exists passed with the following output:\n" - "${HAVE_MFC_OUTPUT}\n\n") - else() - message(STATUS "Looking for MFC - not found") - set(HAVE_MFC "" CACHE INTERNAL "Have MFC") - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if MFC exists failed with the following output:\n" - "${HAVE_MFC_OUTPUT}\n\n") - endif() - endif() - - if(CTEST_RUN_MFC AND NOT HAVE_MFC) - message(STATUS - "cannot compile simplest ever MFC app, avoiding MFC test") - set(CTEST_RUN_MFC OFF) - endif() - endif() - endif() - - if(CTEST_RUN_MFC) + if(CMake_TEST_MFC) add_test(MFC ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/MFC" diff --git a/Tests/RunCMake/ExternalProject/UsesTerminal-check.cmake b/Tests/RunCMake/ExternalProject/UsesTerminal-check.cmake index 201d822..2946c0b 100644 --- a/Tests/RunCMake/ExternalProject/UsesTerminal-check.cmake +++ b/Tests/RunCMake/ExternalProject/UsesTerminal-check.cmake @@ -37,10 +37,11 @@ endmacro() # Check Ninja build output to verify whether each target step is in the # console pool. macro(CheckNinjaTarget _target - _download _update _configure _build _test _install + _download _update _patch _configure _build _test _install ) CheckNinjaStep(${_target} download ${_download}) CheckNinjaStep(${_target} update ${_update}) + CheckNinjaStep(${_target} patch ${_patch}) CheckNinjaStep(${_target} configure ${_configure}) CheckNinjaStep(${_target} build ${_build}) CheckNinjaStep(${_target} test ${_test}) @@ -88,10 +89,10 @@ endif() # Actual tests: CheckNinjaTarget(TerminalTest1 - true true true true true true ) + true true true true true true true ) CheckNinjaTarget(TerminalTest2 - true false true false true false) + true false true false true false true) CheckNinjaTarget(TerminalTest3 - false true false true false true ) + false true false true false true false) CheckNinjaTarget(TerminalTest4 - false false false false false false) + false false false false false false false) diff --git a/Tests/RunCMake/ExternalProject/UsesTerminal.cmake b/Tests/RunCMake/ExternalProject/UsesTerminal.cmake index d3494fd..4f10b6c 100644 --- a/Tests/RunCMake/ExternalProject/UsesTerminal.cmake +++ b/Tests/RunCMake/ExternalProject/UsesTerminal.cmake @@ -10,6 +10,7 @@ macro(DoTerminalTest _target) ExternalProject_Add(${_target} DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E echo "download" UPDATE_COMMAND "${CMAKE_COMMAND}" -E echo "update" + PATCH_COMMAND "${CMAKE_COMMAND}" -E echo "patch" CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "configure" BUILD_COMMAND "${CMAKE_COMMAND}" -E echo "build" TEST_COMMAND "${CMAKE_COMMAND}" -E echo "test" @@ -22,6 +23,7 @@ endmacro() DoTerminalTest(TerminalTest1 USES_TERMINAL_DOWNLOAD 1 USES_TERMINAL_UPDATE 1 + USES_TERMINAL_PATCH 1 USES_TERMINAL_CONFIGURE 1 USES_TERMINAL_BUILD 1 USES_TERMINAL_TEST 1 @@ -31,15 +33,16 @@ DoTerminalTest(TerminalTest1 # USES_TERMINAL on every other step, starting with download DoTerminalTest(TerminalTest2 USES_TERMINAL_DOWNLOAD 1 - USES_TERMINAL_CONFIGURE 1 - USES_TERMINAL_TEST 1 + USES_TERMINAL_PATCH 1 + USES_TERMINAL_BUILD 1 + USES_TERMINAL_INSTALL 1 ) # USES_TERMINAL on every other step, starting with update DoTerminalTest(TerminalTest3 USES_TERMINAL_UPDATE 1 - USES_TERMINAL_BUILD 1 - USES_TERMINAL_INSTALL 1 + USES_TERMINAL_CONFIGURE 1 + USES_TERMINAL_TEST 1 ) # USES_TERMINAL on no step diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt index 9c0b775..01b39c3 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt @@ -49,6 +49,8 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__osbtext"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"__csb___text"!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__csb___text"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:param/special\.case/"S o m e "!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"S o m e "!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"backslash\\"!1 @@ -63,6 +65,8 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__osbtext"!1 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!1 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!1 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:ns\.param/special\.case/"S o m e "!1 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"S o m e "!1 \.+ +Passed +[0-9.]+ sec 100% tests passed, 0 tests failed out of [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt index b0210c6..796e20c 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt @@ -49,6 +49,8 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__osbtext"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:param/special\.case/"__csb___text"!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"__csb___text"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:param/special\.case/"S o m e "!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:param/special\.case/"S o m e "!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"backslash\\"!2 @@ -63,6 +65,8 @@ Test project .* *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__osbtext"!2 \.+ +Passed +[0-9.]+ sec *Start +[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!2 *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"__csb___text"!2 \.+ +Passed +[0-9.]+ sec + *Start +[0-9]+: TEST:ns\.param/special\.case/"S o m e "!2 + *[0-9]+/[0-9]+ +Test +#[0-9]+: TEST:ns\.param/special\.case/"S o m e "!2 \.+ +Passed +[0-9.]+ sec 100% tests passed, 0 tests failed out of [0-9]+ diff --git a/Tests/RunCMake/GoogleTest/fake_gtest.cpp b/Tests/RunCMake/GoogleTest/fake_gtest.cpp index aa6468c..183e106 100644 --- a/Tests/RunCMake/GoogleTest/fake_gtest.cpp +++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv) std::cout << " case/4 # GetParam() = \"]]=]\"" << std::endl; std::cout << " case/5 # GetParam() = \"__osbtext\"" << std::endl; std::cout << " case/6 # GetParam() = \"__csb___text\"" << std::endl; + std::cout << " case/7 # GetParam() = \"S o m e \"" << std::endl; } } return 0; |