mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-11 12:00:48 -05:00
Tests/RunCMake: Organize README as multiple sections
This commit is contained in:
@@ -10,12 +10,16 @@ See also `../README.rst`_ and the `CMake Source Code Guide`_.
|
|||||||
|
|
||||||
.. _`../README.rst`: ../README.rst
|
.. _`../README.rst`: ../README.rst
|
||||||
.. _`CMake Source Code Guide`: ../../Help/dev/source.rst
|
.. _`CMake Source Code Guide`: ../../Help/dev/source.rst
|
||||||
|
.. _`CMakeLists.txt`: CMakeLists.txt
|
||||||
|
|
||||||
|
Adding a Test
|
||||||
|
=============
|
||||||
|
|
||||||
To add a test:
|
To add a test:
|
||||||
|
|
||||||
1. Add a subdirectory named for the test, say ``<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>``.
|
test directory name ``<Test>``.
|
||||||
|
|
||||||
3. Create script ``<Test>/RunCMakeTest.cmake`` in the directory containing::
|
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``
|
The check script may optionally set ``RunCMake_TEST_FAILURE_MESSAGE``
|
||||||
with additional text to be included in the message if the test fails.
|
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
|
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
|
``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the
|
||||||
``RunCMake_TEST_FILTER`` environment variable. If this variable is set,
|
``RunCMake_TEST_FILTER`` environment variable. If this variable is set,
|
||||||
|
|||||||
Reference in New Issue
Block a user