diff options
author | Brad King <brad.king@kitware.com> | 2024-05-23 18:36:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-05-23 18:38:51 (GMT) |
commit | 0add7a802fef644814e2144344d7522116fcc962 (patch) | |
tree | 125001aa6b8894a35a6b4370d70c671607d6117a /Tests/RunCMake | |
parent | aff4dc47c4dc80595e4d8b75215a193bbcc41543 (diff) | |
download | CMake-0add7a802fef644814e2144344d7522116fcc962.zip CMake-0add7a802fef644814e2144344d7522116fcc962.tar.gz CMake-0add7a802fef644814e2144344d7522116fcc962.tar.bz2 |
Tests/RunCMake: Organize README as multiple sections
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/README.rst | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst index 9ff7ed2..90fe126 100644 --- a/Tests/RunCMake/README.rst +++ b/Tests/RunCMake/README.rst @@ -10,12 +10,16 @@ See also `../README.rst`_ and the `CMake Source Code Guide`_. .. _`../README.rst`: ../README.rst .. _`CMake Source Code Guide`: ../../Help/dev/source.rst +.. _`CMakeLists.txt`: CMakeLists.txt + +Adding a Test +============= To add a test: 1. Add a subdirectory named for the test, say ``<Test>/``. -2. In ``./CMakeLists.txt`` call ``add_RunCMake_test`` and pass the +2. In `CMakeLists.txt`_ call ``add_RunCMake_test`` and pass the test directory name ``<Test>``. 3. Create script ``<Test>/RunCMakeTest.cmake`` in the directory containing:: @@ -96,6 +100,14 @@ To add a test: The check script may optionally set ``RunCMake_TEST_FAILURE_MESSAGE`` with additional text to be included in the message if the test fails. +Running a Test +============== + +Each call to ``add_RunCMake_test(Example)`` in `CMakeLists.txt`_ creates +a test named ``RunCMake.Example`` that may be run with ``ctest``:: + + $ ctest -R "^RunCMake\.Example$" + To speed up local testing, you can choose to run only a subset of ``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the ``RunCMake_TEST_FILTER`` environment variable. If this variable is set, |