From 8689b62304f2e5d55ecc36a2c0202ac511c7ca74 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sun, 6 Jun 2021 20:04:37 -0400 Subject: [PATCH] Unit tests: Don't run in parallel on Windows --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81ba6fa4..a3535ec9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,13 +183,18 @@ if(NOT Catch2_FOUND) endif() if(BUILD_TESTING) include(Catch) + # Parallel tests seem to hang randomly on Windows if(ENABLE_PARALLEL_CTEST) - # Figure out the amount of parallelism for CTest - include(ProcessorCount) - ProcessorCount(CPU_COUNT) - if(CPU_COUNT GREATER 1) - add_feature_info("Parallel tests" TRUE "Unit tests can use ${CPU_COUNT} processors") - list(APPEND CTEST_OPTIONS "-j${CPU_COUNT}") + if(WIN32) + message(WARNING "Win32 detected, disabling parallel unit tests") + else() + # Figure out the amount of parallelism for CTest + include(ProcessorCount) + ProcessorCount(CPU_COUNT) + if(CPU_COUNT GREATER 1) + add_feature_info("Parallel tests" TRUE "Unit tests can use ${CPU_COUNT} processors") + list(APPEND CTEST_OPTIONS "-j${CPU_COUNT}") + endif() endif() endif() if(VERBOSE_TESTS)