diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-04 15:22:34 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-08 13:27:19 (GMT) |
commit | cbcb92d1cb4230426761fb7d08f9135546c98881 (patch) | |
tree | 18fa4c3f5e3b53700aa2f9cf18bd9ad34116b6bb /Help/command/ctest_test.rst | |
parent | acb25d50d9d37e93cafcbbc4401e1b45029b6461 (diff) | |
download | CMake-cbcb92d1cb4230426761fb7d08f9135546c98881.zip CMake-cbcb92d1cb4230426761fb7d08f9135546c98881.tar.gz CMake-cbcb92d1cb4230426761fb7d08f9135546c98881.tar.bz2 |
ctest: add support for attaching files to tests at run time
Allow tests to specify files to upload at runtime. Previously this was
only possible to specify at configure time with the ATTACHED_FILES
test properties.
This commit also fixes a bug in how our test data tarballs were generated
by CTest. Previously, if you tried to attach a file outside of the binary
directory, CTest would generate a tar file with a relative path, and tar
would not allow you to extract it. We resolve this problem by creating
tar files with a flat directory structure instead.
Fixes: #22284
Diffstat (limited to 'Help/command/ctest_test.rst')
-rw-r--r-- | Help/command/ctest_test.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst index c61d01e..65555a6 100644 --- a/Help/command/ctest_test.rst +++ b/Help/command/ctest_test.rst @@ -248,5 +248,14 @@ separate from the interactive comparison UI. Attached Files """""""""""""" -To associate other types of files with a test, use the -:prop_test:`ATTACHED_FILES` or :prop_test:`ATTACHED_FILES_ON_FAIL` test properties. +The following example demonstrates how to upload non-image files to CDash. + +.. code-block:: c++ + + std::cout << + "<DartMeasurementFile type=\"file\" name=\"MyTestInputData\">" << + "/dir/to/data.csv</DartMeasurementFile>" << std::endl; + +If the name of the file to upload is known at configure time, you can use the +:prop_test:`ATTACHED_FILES` or :prop_test:`ATTACHED_FILES_ON_FAIL` test +properties instead. |