From e80362252fbb06b2e71b9e46076ff2342e4ae353 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 28 Sep 2020 09:57:24 -0400 Subject: ci: support a max parallelism for tests Machines may have more cores than testing actually supports. --- .gitlab/ci/ctest_test.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab/ci/ctest_test.cmake b/.gitlab/ci/ctest_test.cmake index 569139d..08ef18f 100644 --- a/.gitlab/ci/ctest_test.cmake +++ b/.gitlab/ci/ctest_test.cmake @@ -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( -- cgit v0.12