From 7817aa6fa4097a2c642ff1333be72f93a6e32ed1 Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Wed, 23 Jun 2021 15:34:59 -0400 Subject: ctest: improve test for runtime labels Check for the whole expected output string rather than particular substrings. This verifies that newlines are stripped for any lines found in the test output. --- Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake b/Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake index beb39de..eaa50d1 100644 --- a/Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake +++ b/Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake @@ -20,9 +20,6 @@ if(NOT n_matches EQUAL 1) endif() # Check test output. -if(NOT _test_contents MATCHES "before") - string(APPEND RunCMake_TEST_FAILED "Could not find expected string 'before' in Test.xml") -endif() -if(NOT _test_contents MATCHES "after") - string(APPEND RunCMake_TEST_FAILED "Could not find expected string 'after' in Test.xml") +if(NOT _test_contents MATCHES "before\nafter\n") + string(APPEND RunCMake_TEST_FAILED "Could not find expected output in Test.xml") endif() -- cgit v0.12