From 0add7a802fef644814e2144344d7522116fcc962 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 23 May 2024 14:36:06 -0400 Subject: Tests/RunCMake: Organize README as multiple sections --- Tests/RunCMake/README.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 ``/``. -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 ````. 3. Create script ``/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, -- cgit v0.12