summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/CMakeLists.txt3
-rw-r--r--Tests/CMakeTestAllGenerators/RunCMake.cmake57
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