diff options
author | Brad King <brad.king@kitware.com> | 2017-04-19 14:42:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-19 14:46:10 (GMT) |
commit | a7e0453a3238cbd617cf2fff7388fd3d879dfd65 (patch) | |
tree | c5c878f9b65a261c935ad37cd934640eb407a4e6 /Tests | |
parent | 334efdebb8c69e6327fecb42ed1ae3cfcdb1cad6 (diff) | |
parent | 9e338b57b7a7094b150e10512e6fd758e19eac8c (diff) | |
download | CMake-a7e0453a3238cbd617cf2fff7388fd3d879dfd65.zip CMake-a7e0453a3238cbd617cf2fff7388fd3d879dfd65.tar.gz CMake-a7e0453a3238cbd617cf2fff7388fd3d879dfd65.tar.bz2 |
Merge topic 'fix-CMakeTestAllGenerators'
9e338b57 Tests: Drop machine-specific logic from CMakeTestAllGenerators
2790ffc9 Tests: Run CMakeTestAllGenerators serially
f1e51ec3 Tests: Fix CMakeTestAllGenerators generator list
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !720
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/CMakeTestAllGenerators/RunCMake.cmake | 57 |
2 files changed, 11 insertions, 49 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 491d974..e270748 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1158,6 +1158,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") + # This test runs a lot of processes. Do not make them compete + # for resources with other tests. + set_property(TEST CMakeTestAllGenerators PROPERTY RUN_SERIAL 1) endif() if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) diff --git a/Tests/CMakeTestAllGenerators/RunCMake.cmake b/Tests/CMakeTestAllGenerators/RunCMake.cmake index 6d27d3b..bfbb3a5 100644 --- a/Tests/CMakeTestAllGenerators/RunCMake.cmake +++ b/Tests/CMakeTestAllGenerators/RunCMake.cmake @@ -9,42 +9,23 @@ endif() # Analyze 'cmake --help' output for list of available generators: # execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}) -execute_process(COMMAND ${CMAKE_COMMAND} --help +execute_process(COMMAND ${CMAKE_COMMAND} -E capabilities RESULT_VARIABLE result OUTPUT_VARIABLE stdout ERROR_VARIABLE stderr WORKING_DIRECTORY ${dir}) -string(REPLACE ";" "\\;" stdout "${stdout}") -string(REPLACE "\n" "E;" stdout "${stdout}") - -set(collecting 0) set(generators) -foreach(eline ${stdout}) - string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}") - if(collecting AND NOT line STREQUAL "") - if(line MATCHES "=") - string(REGEX REPLACE "^ (.+)= (.*)$" "\\1" gen "${line}") - if(gen MATCHES "[A-Za-z]") - string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}") - if(gen) - set(generators ${generators} ${gen}) - endif() - endif() - else() - if(line MATCHES "^ [A-Za-z0-9]") - string(REGEX REPLACE "^ (.+)$" "\\1" gen "${line}") - string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}") - if(gen) - set(generators ${generators} ${gen}) - endif() - endif() +string(REGEX MATCHALL [["name":"[^"]+","platformSupport"]] generators_json "${stdout}") +foreach(gen_json IN LISTS generators_json) + if("${gen_json}" MATCHES [["name":"([^"]+)"]]) + set(gen "${CMAKE_MATCH_1}") + if(NOT gen MATCHES " (Win64|IA64|ARM)$") + list(APPEND generators "${gen}") endif() endif() - if(line STREQUAL "The following generators are available on this platform:") - set(collecting 1) - endif() endforeach() +list(REMOVE_DUPLICATES generators) # Also call with one non-existent generator: # @@ -60,28 +41,6 @@ message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") message(STATUS "CMake generators='${generators}'") -# If we'll be testing any of the MinGW Makefiles generators, adjust the -# ENV{PATH} to make sure libgmp-10.dll can be loaded as needed. But only if -# the testing machine has a default MinGW install... (If you have a -# non-default install, append to the PATH before running the test...) -# -if(generators MATCHES "MinGW Makefiles") - if(EXISTS "C:/MinGW/bin/libgmp-10.dll") - string(TOLOWER "$ENV{PATH}" path) - if(NOT path MATCHES "/mingw/bin") - if(UNIX) - set(sep ":") - set(mingw_bin "/mingw/bin") - else() - set(sep ";") - set(mingw_bin "C:/MinGW/bin") - endif() - set(ENV{PATH} "$ENV{PATH}${sep}${mingw_bin}") - message(STATUS "info: appending '${sep}${mingw_bin}' to the PATH") - endif() - endif() -endif() - # First setup a source tree to run CMake on. # execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory |