From 7c15d79a932b621a6fed429ccff41d801896d8d0 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 13 Aug 2019 11:33:06 +0200 Subject: [PATCH] changed: run tests in parallel with the 'check' target --- cmake/Modules/OpmLibMain.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/OpmLibMain.cmake b/cmake/Modules/OpmLibMain.cmake index 12c2226b6..e22de6e85 100644 --- a/cmake/Modules/OpmLibMain.cmake +++ b/cmake/Modules/OpmLibMain.cmake @@ -261,9 +261,13 @@ macro (cond_disable_test name) endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name})) endmacro (cond_disable_test name) -# use this target to run all tests +# use this target to run all tests, with parallel execution +cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES) +if(TESTJOBS EQUAL 0) + set(TESTJOBS 1) +endif() add_custom_target (check - COMMAND ${CMAKE_CTEST_COMMAND} + COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS} DEPENDS test-suite COMMENT "Checking if library is functional" VERBATIM