ci: support a max parallelism for tests

Machines may have more cores than testing actually supports.
This commit is contained in:
Ben Boeckel
2020-09-28 09:57:24 -04:00
parent 93a745683b
commit e80362252f

View File

@@ -10,6 +10,11 @@ ctest_start(APPEND)
include(ProcessorCount)
ProcessorCount(nproc)
if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "")
if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}")
set(nproc "$ENV{CTEST_MAX_PARALLELISM}")
endif ()
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
ctest_test(