summaryrefslogtreecommitdiffstats
path: root/Help/manual
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-15 18:55:35 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-03 13:30:07 (GMT)
commit80fe56c481a5e69cd5ee4fbbbd77266579f96d98 (patch)
tree0f6c1657aa64a25265264bcefd792abd28758d59 /Help/manual
parent5396f4a9a30d11ae17a1a991e54d4e0714457590 (diff)
downloadCMake-80fe56c481a5e69cd5ee4fbbbd77266579f96d98.zip
CMake-80fe56c481a5e69cd5ee4fbbbd77266579f96d98.tar.gz
CMake-80fe56c481a5e69cd5ee4fbbbd77266579f96d98.tar.bz2
ctest: Add support for running under a make job server on POSIX systems
Share job slots with the job server by acquiring a token before running each test, and releasing the token when the test finishes.
Diffstat (limited to 'Help/manual')
-rw-r--r--Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make2
-rw-r--r--Help/manual/ctest.1.rst25
2 files changed, 27 insertions, 0 deletions
diff --git a/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make b/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
new file mode 100644
index 0000000..a17673a
--- /dev/null
+++ b/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
@@ -0,0 +1,2 @@
+test:
+ +ctest -j 8
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 9f7c72e..b519ccf 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1841,6 +1841,31 @@ fixture in their :prop_test:`FIXTURES_REQUIRED`, and a resource spec file may
not be specified with the ``--resource-spec-file`` argument or the
:variable:`CTEST_RESOURCE_SPEC_FILE` variable.
+.. _`ctest-job-server-integration`:
+
+Job Server Integration
+======================
+
+.. versionadded:: 3.29
+
+On POSIX systems, when running under the context of a `Job Server`_,
+CTest shares its job slots. This is independent of the :prop_test:`PROCESSORS`
+test property, which still counts against CTest's :option:`-j <ctest -j>`
+parallel level. CTest acquires exactly one token from the job server before
+running each test, and returns it when the test finishes.
+
+For example, consider the ``Makefile``:
+
+.. literalinclude:: CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
+ :language: make
+
+When invoked via ``make -j 2 test``, ``ctest`` connects to the job server,
+acquires a token for each test, and runs at most 2 tests concurrently.
+
+On Windows systems, job server integration is not yet implemented.
+
+.. _`Job Server`: https://www.gnu.org/software/make/manual/html_node/Job-Slots.html
+
See Also
========