Step 5: Instrumentation

Added in version 4.3.

This step extends Step 3 by enabling instrumentation, which records the time taken by each configure, build, and test command and submits it to CDash.

Step5/submit.cmake
# Enable instrumentation.  This is often set by the calling environment
# instead, such as a CI job definition.
set(ENV{CTEST_USE_INSTRUMENTATION} "ON")

Setting the CTEST_USE_INSTRUMENTATION environment variable before the dashboard steps run enables instrumentation. The rest of the script is the same as Step 3.

The variable can also be set by the environment that runs the script, such as a CI job definition. This lets the same script run with or without instrumentation:

CTEST_USE_INSTRUMENTATION=ON ctest -S Step5/submit.cmake -V

See the cmake-instrumentation(7) manual for details about the data that is submitted.

Requirements