cmake/Tests: Default to half the cores

Saturating all cores easily leads to timeouts.

The system might be doing something else, and it only leaves at most
one core per-test.

E.g. this will cause 90% of runs to fail on a raspberry pi 4.

Note that we set CTEST_PARALLEL_LEVEL on our CI machines anyway, so
this will not affect them.
This commit is contained in:
Fabian Boehm 2025-01-14 17:52:17 +01:00
parent 23f218eb8e
commit 021b18335c

View File

@ -8,7 +8,8 @@ if(NOT CTEST_PARALLEL_LEVEL)
if(NOT CTEST_PARALLEL_LEVEL)
include(ProcessorCount)
ProcessorCount(CORES)
set(CTEST_PARALLEL_LEVEL ${CORES})
math(EXPR halfcores "${CORES} / 2")
set(CTEST_PARALLEL_LEVEL ${halfcores})
endif()
endif()