From 08751f67c8a7dab953132328870b116585c1bf10 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 4 Jul 2023 15:45:48 -0500 Subject: [PATCH] =?utf8?q?Tests:=20set=20expected=20stage=20to=20=C2=BBPAS?= =?utf8?q?SED=C2=AB=20when=20not=20comparing=20output=20and=20expect=3DDIF?= =?utf8?q?F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- cmake/macros/macro_deal_ii_add_test.cmake | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 8a3e7e20c2..40ede17232 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -210,6 +210,17 @@ function(deal_ii_add_test _category _test_name _comparison_file) return() endif() + # + # Determine whether the .run_only keyword is present. + # + # In case no numdiff executable was found we fall back to simply running + # the tests as well (but not comparing them). + # + set(_run_only FALSE) + if(_file MATCHES "\\.run_only$" OR "${NUMDIFF_EXECUTABLE}" STREQUAL "") + set(_run_only TRUE) + endif() + # # Determine the expected build stage of this test: # @@ -222,14 +233,11 @@ function(deal_ii_add_test _category _test_name _comparison_file) endif() # - # Determine whether the .run_only keyword is present. - # - # In case no numdiff executable was found we fall back to simply running - # the tests as well (but not comparing them). + # If _run_only is set then we don't compare test results. Therefore, + # we won't fail in the "DIFF" stage of a test. # - set(_run_only FALSE) - if(_file MATCHES "\\.run_only$" OR "${NUMDIFF_EXECUTABLE}" STREQUAL "") - set(_run_only TRUE) + if(_run_only AND "${_expect}" STREQUAL "DIFF") + set(_expect "PASSED") endif() # -- 2.39.5