1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-23 18:08:31 +08:00

CTest: Improve formatting of documentation cmake code blocks

This commit is contained in:
Brad King
2024-10-24 11:42:58 -04:00
parent 5b4dbd87f1
commit 6e6e688b80

View File

@@ -8,7 +8,9 @@ CTest
Configure a project for testing with CTest/CDash Configure a project for testing with CTest/CDash
Include this module in the top CMakeLists.txt file of a project to Include this module in the top CMakeLists.txt file of a project to
enable testing with CTest and dashboard submissions to CDash:: enable testing with CTest and dashboard submissions to CDash:
.. code-block:: cmake
project(MyProject) project(MyProject)
... ...
@@ -16,7 +18,9 @@ enable testing with CTest and dashboard submissions to CDash::
The module automatically creates a ``BUILD_TESTING`` option that selects The module automatically creates a ``BUILD_TESTING`` option that selects
whether to enable testing support (``ON`` by default). After including whether to enable testing support (``ON`` by default). After including
the module, use code like:: the module, use code like:
.. code-block:: cmake
if(BUILD_TESTING) if(BUILD_TESTING)
# ... CMake code to create tests ... # ... CMake code to create tests ...
@@ -25,7 +29,9 @@ the module, use code like::
to creating tests when testing is enabled. to creating tests when testing is enabled.
To enable submissions to a CDash server, create a ``CTestConfig.cmake`` To enable submissions to a CDash server, create a ``CTestConfig.cmake``
file at the top of the project with content such as:: file at the top of the project with content such as:
.. code-block:: cmake
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_SUBMIT_URL "http://my.cdash.org/submit.php?project=MyProject") set(CTEST_SUBMIT_URL "http://my.cdash.org/submit.php?project=MyProject")
@@ -40,7 +46,9 @@ build output for errors and warnings and reports them with surrounding
context from the build log. This generic approach works for all build context from the build log. This generic approach works for all build
tools, but does not give details about the command invocation that tools, but does not give details about the command invocation that
produced a given problem. One may get more detailed reports by setting produced a given problem. One may get more detailed reports by setting
the :variable:`CTEST_USE_LAUNCHERS` variable:: the :variable:`CTEST_USE_LAUNCHERS` variable:
.. code-block:: cmake
set(CTEST_USE_LAUNCHERS 1) set(CTEST_USE_LAUNCHERS 1)