diff options
author | Brad King <brad.king@kitware.com> | 2021-06-09 12:04:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-09 12:04:23 (GMT) |
commit | 5c18c8a178c2504975760d6c52d71a2a32774159 (patch) | |
tree | 619ebc01eaa1adeec58a0f7c1eb816af3b6c1022 /Tests | |
parent | 1d225c5c0ca86592e835b626c55aa6bf4faa2f3d (diff) | |
parent | cbcb92d1cb4230426761fb7d08f9135546c98881 (diff) | |
download | CMake-5c18c8a178c2504975760d6c52d71a2a32774159.zip CMake-5c18c8a178c2504975760d6c52d71a2a32774159.tar.gz CMake-5c18c8a178c2504975760d6c52d71a2a32774159.tar.bz2 |
Merge topic 'ctest_measurement_file'
cbcb92d1cb ctest: add support for attaching files to tests at run time
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6192
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/ctest_test/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestMeasurements-check.cmake | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake index b559e89..76a63f0 100644 --- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake @@ -161,6 +161,10 @@ 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 file_measurement + COMMAND ${CMAKE_COMMAND} -E + echo <DartMeasurementFile name="my_test_input_data" type="file">]] ${IMAGE_DIR}/cmake-logo-16.png [[</DartMeasurementFile>) ]]) run_ctest(TestMeasurements) endfunction() diff --git a/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake b/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake index 9ff9447..0095db0 100644 --- a/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake +++ b/Tests/RunCMake/ctest_test/TestMeasurements-check.cmake @@ -15,3 +15,8 @@ if(NOT _test_contents MATCHES [[NamedMeasurement name="TestImage" type="image/pn string(APPEND RunCMake_TEST_FAILED "Could not find expected <NamedMeasurement> tag 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() |