From a742ddead417ebfd3a9ba6bc32ba6849e341059f Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Mon, 15 Aug 2016 16:32:07 +0200 Subject: [PATCH] opm_add_test: make it possible to hide disabled tests the purpose is to make CI systems like travis happy because ctest counts tests with status "(Not Run)" as failed and returns a non-zero exit code. hiding disabled ctests can be achived by adding the -DADD_DISABLED_CTESTS=OFF cmake parameter. --- cmake/Modules/OpmSatellites.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/OpmSatellites.cmake b/cmake/Modules/OpmSatellites.cmake index 9ed3080d5..cb54d52ad 100644 --- a/cmake/Modules/OpmSatellites.cmake +++ b/cmake/Modules/OpmSatellites.cmake @@ -1,4 +1,8 @@ # - Build satellites that are dependent of main library + +option(ADD_DISABLED_CTESTS "Add the tests which are disabled due to failed preconditions to the ctest output (this makes ctest return an error if such a test is present)" ON) +mark_as_advanced(ADD_DISABLED_CTESTS) + # # Enumerate all source code in a "satellite" directory such as tests/, # compile each of them and optionally set them as a test for CTest to @@ -337,7 +341,7 @@ macro(opm_add_test TestName) # the following causes the test to appear as 'skipped' in the # CDash dashboard. it this is removed, the test is just silently # ignored. - if (NOT CURTEST_ONLY_COMPILE) + if (NOT CURTEST_ONLY_COMPILE AND ADD_DISABLED_CTESTS) add_test(${TestName} skip_test_dummy) endif() endif()