From 5ef5bb931aa3e233caeeb17860b010a56e020006 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 4 May 2023 14:14:01 +0100 Subject: [PATCH] cmake: Emulate GNU Autotools 'make check -jN' --- cmake/tests.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 598af496387d2..f983e4112fb94 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -53,3 +53,11 @@ if(TARGET test_bitcoin) add_all_test_targets() endif() + +if(CMAKE_GENERATOR STREQUAL "Unix Makefiles") + # Emulate GNU Autotools 'make check -jN'. + add_custom_target(check + COMMAND @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan \"Running tests...\" + COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process -$(MAKEFLAGS) + ) +endif()