Files
CMake/Help/dev
Mickaël Germain c11d1ee751 ctest: Add CMAKE coverage tool for CMake listfile coverage
Add a `CMAKE` value for the `CoverageTool` setting, next to `LLVM-COV`.
With it, ctest gives each test its own scratch folder,
`<test-name>_cmake-coverage`, next to the `CTestTestfile.cmake` that
describes the test, and runs the test with CMAKE_LISTFILE_COVERAGE_DIR
set to that folder.  An ambient value of the variable is replaced.
Before the test, ctest removes the folder and the merged file of an
earlier run.

After the test, ctest merges the tracefiles in the folder into one
`<test-name>.cmake-coverage.info` file with a `TN:` record, and removes
the folder.  Coverage problems are warnings and never change the test
result: a folder that cannot be created, an unreadable file, a merged
file that cannot be written, and a test that timed out.  The folder is
kept for inspection when a file was skipped or the write failed.

The merge leaves out the files under ctest's build directory, such as
generated files and `try_compile` projects, unless the build directory
is the source directory.  If no file is left, the test gets no merged
file, as for a test that runs no CMake code.

ctest now also records coverage of the CMake code that it runs itself,
such as `CTestTestfile.cmake` files and dashboard scripts, when
CMAKE_LISTFILE_COVERAGE_DIR is set at startup.  ctest reads the top
`CTestTestfile.cmake` by a relative path, so the collector now makes a
relative listfile path absolute with the current working directory.

Document the tool and add a recipe for CMake's own test suite to
`Tests/RunCMake/README.rst`.

Issue: #28192
2026-11-02 08:19:40 -08:00
..
2026-03-21 08:35:50 +11:00
2026-09-29 08:07:50 -04:00

CMake Development
*****************

This directory contains documentation about development of CMake itself.
It is not part of the user documentation distributed with CMake.

Contributor Instructions
========================

See `CONTRIBUTING.rst`_ for instructions to contribute changes.

The process for contributing changes is the same whether or not one
has been invited to participate directly in upstream development.

.. _`CONTRIBUTING.rst`: ../../CONTRIBUTING.rst

Upstream Development
====================

CMake uses `Kitware's GitLab Instance`_ to manage development, review, and
integration of changes.  The `CMake Repository`_ holds the integration
branches and tags.  Upstream development processes are covered by the
following documents:

* The `CMake Review Process`_ manages integration of changes.
* The `CMake Integration Testing`_ infrastructure tests changes
  before and after merging.

.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`CMake Review Process`: review.rst
.. _`CMake Integration Testing`: integration-testing.rst

Developer Documentation
=======================

CMake developer documentation is provided by the following documents:

* The `CMake Dev Container Guide`_.
* The `CMake Source Code Guide`_.
* The `CMake Documentation Guide`_.
* The `CMake Testing Guide`_.
* The `CMake Experimental Features Guide`_.
* The `CMake Debugging Guide`_.
* The `CMake Diagnostics Guide`_.

.. _`CMake Dev Container Guide`: devcontainer.rst
.. _`CMake Source Code Guide`: source.rst
.. _`CMake Documentation Guide`: documentation.rst
.. _`CMake Testing Guide`: testing.rst
.. _`CMake Experimental Features Guide`: experimental.rst
.. _`CMake Debugging Guide`: debug.rst
.. _`CMake Diagnostics Guide`: diagnostics.rst

Maintainer Documentation
========================

CMake maintainer documentation is provided by the following documents:

* The `CMake Maintainer Guide`_.

.. _`CMake Maintainer Guide`: maint.rst