浏览代码

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 <CTestLabel> lines found
in the test output.
Zack Galbreath 4 年之前
父节点
当前提交
7817aa6fa4
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake

+ 2 - 5
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 "<Value>before\nafter\n</Value>")
+  string(APPEND RunCMake_TEST_FAILED "Could not find expected output in Test.xml")
 endif()