mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
Help/ctest: Add Dashboard Client workflow overview
Distinguish between `ctest -D` and `ctest -S` modes. Include a simple example of a driver script to get users started.
This commit is contained in:
1 parent
64ca71c578
commit
b827b48c74
1 file changed
+65
@@ -874,6 +874,26 @@ dashboard, such as ``Experimental`` or ``NightlyTest``, CTest runs that
|
||||
dashboard. Otherwise, the value is treated as a variable definition;
|
||||
see :option:`-D \<var\>=\<value\> <ctest-dashboard -D>`.
|
||||
|
||||
CTest supports two workflows as a dashboard client:
|
||||
|
||||
`Dashboard Client via CTest Command-Line`_
|
||||
Run :option:`ctest -D` or :option:`ctest -M` and :option:`ctest -T`
|
||||
in a build tree configured by a project that includes the :module:`CTest`
|
||||
module. Settings come from a configuration file the module generates in
|
||||
the build tree. This is suited to developers submitting results for a
|
||||
local build, such as an ``Experimental`` dashboard.
|
||||
|
||||
`Dashboard Client via CTest Script`_
|
||||
Run :option:`ctest -S` with a script that sets the dashboard settings
|
||||
and calls the :ref:`CTest Commands` to run each step. The script can
|
||||
check out the source tree and create the build tree itself. This is
|
||||
suited to machines that submit ``Nightly`` or ``Continuous`` dashboards
|
||||
on a schedule.
|
||||
|
||||
The `Dashboard Client Steps`_ and `Dashboard Client Modes`_ are common to
|
||||
both workflows. The `Dashboard Client Configuration`_ section documents
|
||||
the settings for each step.
|
||||
|
||||
Options for Dashboard Client include:
|
||||
|
||||
.. option:: -D <dashboard>, --dashboard <dashboard>
|
||||
@@ -1129,6 +1149,16 @@ CTest defines three modes of operation as a dashboard client:
|
||||
It enables the ``Start``, ``Configure``, ``Build``, ``Test``, ``Coverage``,
|
||||
and ``Submit`` steps by default.
|
||||
|
||||
By default, CDash displays each submission in a group named after its mode.
|
||||
The :ctest-dashboard-option:`--group` option, or the ``GROUP`` option of the
|
||||
:command:`ctest_start` command, selects a different group.
|
||||
|
||||
CTest also tags each submission with a date. In ``Nightly`` mode, the
|
||||
date is computed relative to the :variable:`CTEST_NIGHTLY_START_TIME`
|
||||
setting so that all submissions from one night share a date. The
|
||||
:ctest-dashboard-option:`--tomorrow-tag` option uses the next day's date
|
||||
instead.
|
||||
|
||||
Dashboard Client via CTest Command-Line
|
||||
---------------------------------------
|
||||
|
||||
@@ -1168,6 +1198,20 @@ generated by the :module:`CTest` module if included by the project.
|
||||
The module uses variables to obtain a value for each setting
|
||||
as documented with the settings below.
|
||||
|
||||
For example, to configure and build a project that includes the
|
||||
:module:`CTest` module, then submit an ``Experimental`` dashboard
|
||||
from its build tree:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
cmake -S <path-to-source> -B <path-to-build>
|
||||
cmake --build <path-to-build>
|
||||
cd <path-to-build>
|
||||
ctest -D Experimental
|
||||
|
||||
The :module:`CTest` module also adds :ref:`dashboard targets
|
||||
<CTest Dashboard Targets>` that run the same steps from the build system.
|
||||
|
||||
.. _`CTest Script`:
|
||||
|
||||
Dashboard Client via CTest Script
|
||||
@@ -1187,6 +1231,27 @@ to run testing steps explicitly as documented below. The commands
|
||||
obtain `Dashboard Client Configuration`_ settings from their
|
||||
arguments or from variables set in the script.
|
||||
|
||||
For example, a minimal script that configures, builds, and tests a
|
||||
project and submits an ``Experimental`` dashboard is:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
set(CTEST_SITE "my-machine")
|
||||
set(CTEST_BUILD_NAME "linux-gcc")
|
||||
set(CTEST_SOURCE_DIRECTORY "/path/to/source")
|
||||
set(CTEST_BINARY_DIRECTORY "/path/to/build")
|
||||
set(CTEST_CMAKE_GENERATOR "Ninja")
|
||||
|
||||
ctest_start(Experimental)
|
||||
ctest_configure()
|
||||
ctest_build()
|
||||
ctest_test()
|
||||
ctest_submit()
|
||||
|
||||
The :command:`ctest_start` command reads the ``CTestConfig.cmake`` file
|
||||
from the source or binary directory, if one exists, to obtain settings
|
||||
such as :variable:`CTEST_SUBMIT_URL`.
|
||||
|
||||
Dashboard Client Configuration
|
||||
==============================
|
||||
|
||||
|
||||
Reference in new issue
Block a user