diff options
author | Brad King <brad.king@kitware.com> | 2021-07-02 13:00:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-02 13:00:56 (GMT) |
commit | 373608831099bf96f568d9db5cb12a3f9092edf4 (patch) | |
tree | 5607bdfa72c03860d64df7fbf4c6912f0978c76b /Tests | |
parent | c1346f67c87fe0c470021ab0089529ee7385d771 (diff) | |
parent | 0962cbf21de45937c0109b953d569f6be1b7bf8f (diff) | |
download | CMake-373608831099bf96f568d9db5cb12a3f9092edf4.zip CMake-373608831099bf96f568d9db5cb12a3f9092edf4.tar.gz CMake-373608831099bf96f568d9db5cb12a3f9092edf4.tar.bz2 |
Merge topic 'ctest_not_dart'
0962cbf21d help: update ctest attached file example
5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
7817aa6fa4 ctest: improve test for runtime labels
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6296
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/ctest_test/RunCMakeTest.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestExtraLabels-check.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestMeasurements-check.cmake | 18 |
3 files changed, 32 insertions, 5 deletions
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake index 31bc075..a211c66 100644 --- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake @@ -158,13 +158,25 @@ add_test( COMMAND ${CMAKE_COMMAND} -E echo <DartMeasurement type="numeric/double" name="my_custom_value">1.4847</DartMeasurement>) add_test( + NAME double_measurement2 + COMMAND ${CMAKE_COMMAND} -E + echo <CTestMeasurement type="numeric/double" name="another_custom_value">1.8474</CTestMeasurement>) +add_test( NAME img_measurement COMMAND ${CMAKE_COMMAND} -E echo <DartMeasurementFile name="TestImage" type="image/png">]] ${IMAGE_DIR}/cmake-logo-16.png [[</DartMeasurementFile>) add_test( + NAME img_measurement2 + COMMAND ${CMAKE_COMMAND} -E + echo <CTestMeasurementFile name="TestImage2" type="image/png">]] ${IMAGE_DIR}/cmake-logo-16.png [[</CTestMeasurementFile>) +add_test( NAME file_measurement COMMAND ${CMAKE_COMMAND} -E echo <DartMeasurementFile name="my_test_input_data" type="file">]] ${IMAGE_DIR}/cmake-logo-16.png [[</DartMeasurementFile>) +add_test( + NAME file_measurement2 + COMMAND ${CMAKE_COMMAND} -E + echo <CTestMeasurementFile name="another_test_input_data" type="file">]] ${IMAGE_DIR}/cmake-logo-16.png [[</CTestMeasurementFile>) ]]) run_ctest(TestMeasurements) endfunction() 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 "<Value>before\nafter\n</Value>") + string(APPEND RunCMake_TEST_FAILED "Could not find expected output in Test.xml") endif() diff --git a/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake b/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake index 0095db0..7e0928d 100644 --- a/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake +++ b/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake @@ -10,13 +10,31 @@ endif() if(NOT _test_contents MATCHES "<Value>1.4847</Value>") string(APPEND RunCMake_TEST_FAILED "Could not find expected measurement value in Test.xml") endif() +# Check the other double measurement. +if(NOT _test_contents MATCHES [[NamedMeasurement type="numeric/double" name="another_custom_value"]]) + string(APPEND RunCMake_TEST_FAILED + "Could not find expected <NamedMeasurement> tag(2) for type='numeric/double' in Test.xml") +endif() +if(NOT _test_contents MATCHES "<Value>1.8474</Value>") + string(APPEND RunCMake_TEST_FAILED "Could not find expected measurement value(2) in Test.xml") +endif() # Check img measurement. if(NOT _test_contents MATCHES [[NamedMeasurement name="TestImage" type="image/png" encoding="base64"]]) string(APPEND RunCMake_TEST_FAILED "Could not find expected <NamedMeasurement> tag for type='image/png' in Test.xml") endif() +# Check img measurement 2. +if(NOT _test_contents MATCHES [[NamedMeasurement name="TestImage2" type="image/png" encoding="base64"]]) + string(APPEND RunCMake_TEST_FAILED + "Could not find expected <NamedMeasurement> tag(2) for type='image/png' in Test.xml") +endif() # Check file measurement. if(NOT _test_contents MATCHES [[NamedMeasurement name="my_test_input_data" encoding="base64" compression="tar/gzip" filename="cmake-logo-16.png" type="file"]]) string(APPEND RunCMake_TEST_FAILED "Could not find expected <NamedMeasurement> tag for type='file' in Test.xml") endif() +# Check file measurement 2. +if(NOT _test_contents MATCHES [[NamedMeasurement name="another_test_input_data" encoding="base64" compression="tar/gzip" filename="cmake-logo-16.png" type="file"]]) + string(APPEND RunCMake_TEST_FAILED + "Could not find expected <NamedMeasurement> tag(2) for type='file' in Test.xml") +endif() |