diff options
author | Brad King <brad.king@kitware.com> | 2023-11-15 18:55:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-12-03 13:30:07 (GMT) |
commit | 80fe56c481a5e69cd5ee4fbbbd77266579f96d98 (patch) | |
tree | 0f6c1657aa64a25265264bcefd792abd28758d59 /Help/manual | |
parent | 5396f4a9a30d11ae17a1a991e54d4e0714457590 (diff) | |
download | CMake-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.make | 2 | ||||
-rw-r--r-- | Help/manual/ctest.1.rst | 25 |
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 ======== |