Unit tests: Don't run in parallel on Windows

This commit is contained in:
FeRD (Frank Dana)
2021-06-06 20:04:37 -04:00
parent 9c9f5c8c53
commit 8689b62304

View File

@@ -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)