Commit Graph

46 Commits

Author SHA1 Message Date
Ralf Habacker
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
Add a `CMAKE_TEST_LAUNCHER` variable and corresponding `TEST_LAUNCHER`
target property.

Issue: #23672
2023-12-13 10:20:43 -05:00
scivision
13465306cf
Help: Clarify pass, fail and skip test properties and exit code
The behavior when system-level failures occur was not previously defined.
Clarify the behavior and provide an example for how to work around them.
Affected test properties:

- PASS_REGULAR_EXPRESSION
- FAIL_REGULAR_EXPRESSION
- SKIP_REGULAR_EXPRESSION
- SKIP_RETURN_CODE

Also update the existing WILL_FAIL test property docs to using the same
consistent wording.
2023-11-24 16:41:03 +11:00
scivision
7b4983536a
Help:test prop WILL_FAIL clarify and example
This makes the WILL_FAIL behavior explicit. Users could be confused
because some other build systems treat equivalent test properties
as allowing a failure, but still pass on a passing test, and may
catch SIGABRT unlike CMake.

We show an example of how to wrap a test so that sigabrt, segfault,
etc. are also handled by WILL_FAIL.
2023-11-06 21:46:17 -05:00
Kyle Edwards
c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
Issue: #25106
2023-08-10 16:47:51 -04:00
Brad King
54c5654f7d ctest: Optionally terminate tests with a custom signal on timeout
CTest normally terminates test processes on timeout using `SIGKILL`.
Offer tests a chance to exit gracefully, on platforms supporting POSIX
signals, by setting `TIMEOUT_SIGNAL_{NAME,GRACE_PERIOD}` properties.

Fixes: #17288
2023-06-02 06:51:13 -04:00
Brad King
07b5087ba7 Help: Document meaning of TIMEOUT test property with value 0
Document the behavior added by commit 51bb493574 (Test TIMEOUT property
explicitly set to zero should be honored, 2011-01-03, v2.8.4~118^2).
2023-05-04 16:58:03 -04:00
scivision
6e71c31afd Help:add_test: emphasize important points
* enable_testing must be called to enable testing
* can only set properties on tests created in same directory
* WILL_FAIL still fails on segfault and similar
* compact wording
2023-02-15 16:23:35 -05:00
Ben Boeckel
c36910476a Help: remove links from pages to themselves
At least the top-reference links. Internal `:ref:` usages have been left
intact.
2022-11-18 14:09:32 -05:00
Alex Turbov
029210730a
Help: Use role :program:
When mention execitable names use Sphinx semantic role `:program`
instead of ``executable`` or **executable**.
2022-11-06 04:28:21 +04:00
Alex Turbov
3043c17039 Help: Add more CLI :option: references to various pages 2022-10-20 11:21:40 -04:00
Alex Turbov
4c1008d739 Help: Use :option: role to reference ctest options 2022-08-14 09:58:41 +04:00
Brad King
bc1fd4b606 Merge topic 'doc-list-semicolons'
8abd714176 Help: Clarify that ENVIRONMENT test properties take ;-separated lists
02cf404ace Help: Add advice for dealing with semicolons in lists
c4117d9116 ExternalProject: Document that LIST_SEPARATOR works for CMAKE_ARGS too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7066
2022-03-16 11:14:59 -04:00
Brad King
8abd714176 Help: Clarify that ENVIRONMENT test properties take ;-separated lists
Follow up commit 79f64cc773 (Help: ENVIRONMENT_MODIFICATION clarify only
supports singular values, 2022-02-23) to specifically call out the list
format.

Issue: #23315
2022-03-15 15:49:21 -04:00
Robert Maynard
79f64cc773 Help: ENVIRONMENT_MODIFICATION clarify only supports singular values
Lists need to be externally iterated
2022-02-23 13:07:34 -05:00
Craig Scott
71a2c9d31b Help: ENVIRONMENT_MODIFICATION path_list_... separator is based on host
Fixes: #22937
2021-11-21 17:50:29 +11:00
Craig Scott
250acbb099 Help: Improve cross-referencing of test LABELS and related features 2021-11-13 20:45:05 +11:00
Michael Hirsch
f6177f05da Help: Clarify ENVIRONMENT_MODIFICATION case sensitivity 2021-10-26 09:37:14 -04:00
Brad King
9f0b52b8e6 Help: Update Sphinx versionadded directives for 3.22 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.21.0 --overwrite

Manually select updates that really belong to the 3.22 release, as
against adding documentation for previously-existing entities.
2021-10-07 11:25:51 -04:00
Ben Boeckel
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
This property allows projects to modify environment variables at test
time rather than trying to guess what the state should be based on what
is present at configure time. Of particular interest is the ability to
use a `PATH` present at test time while adding entries known to be
necessary for the test itself.

There are multiple operations provided to modify variables, including:

  - setting and unsetting
  - appending and prepending as:
    - strings
    - path lists
    - CMake lists

Additionally, a `reset` action is provided to cancel any prior
modifications to that particular variable in the case of incremental
additions to the test property.
2021-07-09 08:45:18 -04:00
Ben Boeckel
4c757fa3c8 Help/prop_test/ENVIRONMENT: clarify the scope of the changes
The "restored" bit is an implementation detail as it could also be
implemented by passing a crafted environment to `execve` or
`CreateProcess` arguments. Instead, state that the environment changes
only affects the test with the property set.
2021-07-08 09:19:32 -04:00
Brad King
91b8676f8c Help: Clarify {PASS,FAIL}_REGULAR_EXPRESSION semantics w.r.t. exit code
Also cross-reference them with each other and `SKIP_REGULAR_EXPRESSION`.
2021-05-27 12:11:19 -04:00
Josef Angstenberger
7072d83772
Help: Fix typos and spelling in documentation 2021-05-07 17:00:17 +02:00
Kitware Robot
496ec6036f Help: Add Sphinx 'versionadded' directives to each top-level document
Run the `Utilities/Sphinx/update_versions.py` script to add initial
markup to every top-level document and find module.

Issue: #19715
2020-07-06 10:23:20 -04:00
Michael Hirsch
6b75175219 Help: Add example for REQUIRED_FILES test property 2020-06-09 09:20:23 +10:00
Michael Hirsch
61139c91d2 Help: Add example for DEPENDS test property 2020-06-09 09:04:04 +10:00
Kyle Edwards
a64ba0235f CTest: Clarify that resource requirements can be split
Add a note to the documentation to clarify this, and add test cases
to ensure it.

Fixes: #19987
2019-11-25 11:08:27 -05:00
Craig Scott
a7c1e15cc4 CTest: Rename hardware -> resources for CMake variables, command options
Only changes the user-visible effects of renaming hardware
allocation to resource allocation. Code changes are the minimum
needed to achieve that.
2019-11-05 12:08:35 -05:00
Brad King
af9ed543b0 CTest: Rename PROCESSES test property to RESOURCE_GROUPS
The `PROCESSES` test property name added for CMake 3.16 is too close to
the existing `PROCESSORS` test property.  Furthermore, the property in
principle specifies groups of resources organized in a way that is
meaningful to a particular test.  The groups may often correspond to
processes but they could have other meanings.  Since the property name
`PROCESSES` has not been in a final 3.16 release yet, simply rename it
to `RESOURCE_GROUPS`.

Fixes: #19914
2019-11-05 12:08:01 -05:00
Kyle Edwards
e9500271a3 Help: Add documentation for CTest hardware allocation 2019-10-02 09:33:54 -04:00
Gabor Bencze
407dd1a910 Help: Add documentation for SKIP_REGULAR_EXPRESSION test property 2019-07-18 15:45:09 -04:00
Stephen Manz
365ee32db8 Help: Valid range for test property, SKIP_RETURN_CODE, is 0 to 255, inclusive 2019-07-02 08:46:49 -07:00
Craig Scott
774102aaec Help: Clarify the default value for test property COST
Co-Authored-By: Steve Mokris <smokris@softpixel.com>
2019-06-02 21:08:56 +10:00
Bartosz Kosiorek
456e0fb64f Help: Improve documentation formating 2019-04-04 15:13:58 +02:00
Brad King
6be53c6695 CTest: Add options to control test process affinity to CPUs
In commit v2.8.0~170 (ENH: Added ctest test options PROCESSORS and
RUN_SERIAL, 2009-09-07) CTest learned to track the number of processors
allocated to running tests in order to balance it against the desired
level of parallelism.  Extend this idea by introducing a new
`PROCESSOR_AFFINITY` test property to ask that CTest run a test
with the CPU affinity mask set.  This will allow a set of tests
that are running concurrently to use disjoint CPU resources.
2018-03-05 09:21:32 -05:00
Craig Scott
92a4c236f6 Help: Fix wrong default for WORKING_DIRECTORY test property 2018-02-27 22:28:33 +11:00
Bill Hoffman
b2242ea964 Help: Update documentation for PROCESSORS test property
This updates the documentation for the PROCESSORS test property to show
how it will affect the summary output for labels and sub projects.
2017-09-08 10:03:53 -04:00
Craig Scott
2e3d89a70b Help: Clarify test fixture naming and use
* Make it clearer that fixture names are distinct from test case names.
* Mention -FS, -FC and -FA ctest command line options for overriding
  fixture behavior.

Fixes: #17141
2017-08-08 22:02:07 +10:00
Betsy McPhail
b070947dff Add 'DISABLED' test property
When this property is set, the test is skipped and its status is
automatically set to 'Not Run'.  A disabled test will not be counted in
the total number of tests and its completion status will be 'Disabled'.
2017-03-29 10:29:57 -04:00
Zack Galbreath
909842fff9 CTest: report time spent after matching output
When using the TIMEOUT_AFTER_MATCH test property, only report the
time spent by the test after the matching output was found.
2016-10-17 11:24:32 -04:00
Craig Scott
73f47c9e46 CTest: Add support for test fixtures
Add new test properties:

* FIXTURES_SETUP
* FIXTURES_CLEANUP
* FIXTURES_REQUIRED

to specify the roles and dependencies of tests providing/using
test fixtures.
2016-09-20 14:37:38 -04:00
Gregor Jasny
2d7d33ecb3 Help: Hyperlink properties 2016-04-27 22:38:59 +02:00
Zack Galbreath
993e48d045 CTest: Optionally use a secondary test timeout after matching output
Allow a test N seconds to complete after we detect a matching line in
its output.  Activate this behavior with a new TIMEOUT_AFTER_MATCH test
property.
2016-03-22 11:17:55 -04:00
Stephen Kelly
6f82b5e81c Help: Link to properties in set_tests_properties.
Remove help for specific properties to their own help pages.
2015-04-04 19:14:56 +02:00
Zack Galbreath
56cb4a6c3a Help: Fix variable reference in TIMEOUT test property docs
Link to 'CTEST_TEST_TIMEOUT', not 'CTEST_TESTING_TIMEOUT'.
2015-02-10 12:58:01 -05:00
Rolf Eike Beer
3a0d164bb2 allow to mark a test as "Not Run" with a specific return code (#8466) 2014-01-14 23:57:40 +01:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00