1868 Commits

Author SHA1 Message Date
Brad King
f2596dfa0e macOS: Work around bug in system curl 8.{3,4,5} LibreSSL backend
Since commit d3cbee99e3 (macOS: Prefer building with system-provided
curl, 2024-05-09, v3.30.0-rc1~130^2~1) CMake uses the macOS-provided
curl, which uses the LibreSSL backend by default.  This exposes us to
curl issue 12525, created and fixed by the following upstream curl
commits:

* commit `bec0c5bbf` (openssl: switch to modern init for
                      LibreSSL 2.7.0+, 2023-08-07, `curl-8_3_0~201`)
* commit `9f2d2290d` (openssl: re-match LibreSSL deinit with init,
                      2023-12-15, `curl-8_6_0~219`)

Work around the bug by preferring the secure-transport backend by
default on the problematic versions of curl.
2024-07-17 09:13:26 -04:00
Brad King
e913e7150a Merge topic 'ctest-jobserver-fifo-hang' into release-3.30
ff077af032 ctest: Set close-on-exec for jobserver FIFO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9580
2024-06-06 08:33:56 -04:00
Joan Bruguera Micó
ff077af032 ctest: Set close-on-exec for jobserver FIFO
Set the close-on-exec flag to prevent the jobserver FIFO file
descriptor from leaking to subprocesses spawned by `ctest`.

This leak is usually harmless, but can cause `make test -jN` to hang
at the end of the build if a test leaves a background process running
with the jobserver FIFO file descriptor open.

Fixes: #26027
2024-06-05 09:37:05 -04:00
Brad King
c2949dbdf8 Merge topic 'ctest-invalid-arg'
304396d13c ctest: Show error on invalid ctest arguments
06cb978c1b Tests: Fix ctest flag typo in RunCMake.GoogleTest

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9383
2024-04-05 11:55:47 -04:00
Jake D'Esposito
304396d13c ctest: Show error on invalid ctest arguments
Fixes: #24227
2024-04-03 21:33:19 -04:00
Brad King
83ceca6678 Merge topic 'ctest-resource-lock'
85745cce7a ctest: Restore enforcement of RESOURCE_LOCK test property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9394
2024-04-02 08:09:13 -04:00
Brad King
85745cce7a ctest: Restore enforcement of RESOURCE_LOCK test property
Refactoring in commit 5ff0b4ed57 (cmCTestMultiProcessHandler:
Consolidate test readiness checks, 2023-10-20, v3.29.0-rc1~378^2~4)
accidentally broke `RESOURCE_LOCK`.  Fix it and replace the previous
test with one that would have caught this.

Fixes: #25843
2024-04-01 12:22:29 -04:00
Brad King
7139944264 ctest: Fall back to CMake environment variable for TLS server verification
Use `ENV{CMAKE_TLS_VERIFY}` if `CTEST_TLS_VERIFY` or `CMAKE_TLS_VERIFY`
is not set.

Issue: #23608
2024-03-30 09:22:05 -04:00
Vitaly Stakhovsky
1a49b439a5 Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
2024-03-17 19:05:37 -04:00
Brad King
aeb8bcc055 ctest: Fall back to CMake options for TLS version
Use `CMAKE_TLS_VERSION` or `ENV{CMAKE_TLS_VERSION}` if
`CTEST_TLS_VERSION` is not set.

Issue: #25701
2024-03-12 10:47:08 -04:00
Brad King
56e319ce4a ctest: Fall back to CMake options for TLS server verification
Use `CMAKE_TLS_VERIFY` if `CTEST_TLS_VERIFY` is not set.
2024-03-12 10:46:42 -04:00
Brad King
6671f17f65 ctest: Add explicit options for TLS version
Add a dedicated `TLSVersion` ctest option and a `CTEST_TLS_VERSION`
variable to control it.

Issue: #25701
2024-03-12 10:46:23 -04:00
Brad King
0aba13a2f3 ctest: Add explicit options for TLS server verification
Add a dedicated `TLSVerify` ctest option and a `CTEST_TLS_VERIFY`
variable to control it.  Deprecate `CurlOptions` because it exposes
internal implementation details.
2024-03-12 10:46:11 -04:00
Brad King
8a3a486fb5 cmCTestCurl: Factor out helper struct for curl options 2024-03-12 10:43:38 -04:00
Brad King
7f668bb94f cmCTestCurl: Use inline member initialization 2024-03-12 10:43:38 -04:00
Brad King
89e99cca63 Merge topic 'ctest-j-default'
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
bbcbcff7d9 cmCTestMultiProcessHandler: Modernize member initialization
7457b474a1 Tests: Remove unnecessary parallel suppression from CTestCoverageCollectGCOV
ae69801d96 Tests: Convert CTestTestSkipReturnCode to RunCMake.ctest_test case
30dda49416 Tests: Convert CTestTestSerialOrder to RunCMake.ctest_test case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9315
2024-03-11 10:18:50 -04:00
Brad King
04d8bc6bb9 Merge topic 'ctest-j-default' into release-3.29
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
bbcbcff7d9 cmCTestMultiProcessHandler: Modernize member initialization
7457b474a1 Tests: Remove unnecessary parallel suppression from CTestCoverageCollectGCOV
ae69801d96 Tests: Convert CTestTestSkipReturnCode to RunCMake.ctest_test case
30dda49416 Tests: Convert CTestTestSerialOrder to RunCMake.ctest_test case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9315
2024-03-11 10:18:49 -04:00
Brad King
4905335776 Merge topic 'ctest-tests-from-file'
170ec48601 Help: Improve ctest tests-from-file documentation wording and wrapping
1a4837641e ctest: Remove unnecessary and ambiguous tests-from-file comment syntax
d52c66bfb3 ctest: Honor tests-from-file options with empty input
8673264e25 Tests: Make ctest tests-from-file expected output more precise

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9322
2024-03-11 10:17:00 -04:00
Brad King
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
Under job server integration, added by commit 80fe56c481 (ctest: Add
support for running under a make job server on POSIX systems,
2023-11-15, v3.29.0-rc1~324^2), use a very high default so that
parallelism is effectively limited only by available job server tokens.

Otherwise, choose a default limit based on the number of processors.

Also allow passing `0` to specify unbounded parallelism.

Fixes: #25739
2024-03-10 11:41:39 -04:00
Brad King
bbcbcff7d9 cmCTestMultiProcessHandler: Modernize member initialization 2024-03-10 10:27:05 -04:00
Brad King
1a4837641e ctest: Remove unnecessary and ambiguous tests-from-file comment syntax
Test names can contain `#`.  Since we ignore lines that do not match any
test names anyway, "commenting" can still work without explicit syntax.
Also drop whitespace trimming for similar reasons.

Fixes: #25741
2024-03-08 16:25:33 -05:00
Brad King
d52c66bfb3 ctest: Honor tests-from-file options with empty input
If the `--tests-from-file` input file is empty, no tests should run.
2024-03-08 16:06:35 -05:00
Brad King
0530eca631 Merge topic 'gtest-json-test-def-source'
06860d5c12 ctest: Show custom test properties in --show-only=json-v1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9305
2024-03-08 09:35:26 -05:00
Brad King
35038b65f9 Merge topic 'ctest-tests-from-file'
ca0a9def2e ctest: Exit with failure when tests-from-file input is missing
60433fc6e8 Tests: Generalize ctest tests-from-file test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9317
2024-03-08 09:28:46 -05:00
Brad King
ca0a9def2e ctest: Exit with failure when tests-from-file input is missing
If the options added by

* commit 022f20f663 (ctest: add command line option to run the tests listed
                     in a given file, 2023-11-29, v3.29.0-rc1~66^2~2)
* commit dbacc1d5a8 (ctest: add command line option to exclude tests listed
                     in a given file, 2023-11-30, v3.29.0-rc1~66^2~1)
* commit 701029726f (ctest_test: add options INCLUDE_FROM_FILE and
                     EXCLUDE_FROM_FILE, 2023-12-03, v3.29.0-rc1~66^2)

are given a missing file, fail instead of ignoring it.

Fixes: #25740
2024-03-06 16:14:04 -05:00
Daniel Sim
06860d5c12 ctest: Show custom test properties in --show-only=json-v1 2024-03-06 15:06:20 +00:00
Zack Galbreath
b47ccc6ba0 ctest: include "Time" element in Upload.xml
Add a `<Time>` element to Upload.xml that contains the Unix timestamp
when this file was generated. This matches the data recorded by CTest in its
other XML files.
2024-02-27 13:51:11 -05:00
Christoph Grüninger
c934a881e7 Reduce scope of variable
Found by Cppcheck (variableScope)
2024-02-14 20:46:03 +01:00
Christoph Grüninger
95a9494974 Remove unused variable
Found by Cppcheck.
2024-02-14 20:46:02 +01:00
Kyle Edwards
b9bfd411cb CTest: Throw error if resource spec is invalid 2024-02-08 09:02:33 -05:00
Brad King
d9b9f63083 Merge topic 'ctest-tests-from-file'
701029726f ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE
dbacc1d5a8 ctest: add command line option to exclude tests listed in a given file
022f20f663 ctest: add command line option to run the tests listed in a given file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9128
2024-01-26 10:14:58 -05:00
Alex Neundorf
701029726f ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE
These options can be used to specify files which can be used
to restrict the set of tests that will be executed.

Fixes: #25455
2024-01-25 12:38:04 -05:00
Alex Neundorf
dbacc1d5a8 ctest: add command line option to exclude tests listed in a given file
Add `--exclude-from-file <filename>` to exclude the tests listed in the
given file.

Issue: #25455
2024-01-25 12:37:56 -05:00
Alex Neundorf
022f20f663 ctest: add command line option to run the tests listed in a given file
Add `--tests-from-file <filename>` to run only the tests listed in the
given file.  The test names must match exactly, no regexps or something.
The listed tests can still be filtered with a regexp using -R.

Issue: #25455
2024-01-25 12:37:16 -05:00
Brad King
b11c8c45f9 Merge topic 'cmuvprocesschain'
adb3e13d32 cmUVProcessChain: Tolerate fileno() of invalid FILE stream
b6e4e4babc cmUVProcessChain: Simplify SetExternalStream usage
116bb2b70f cmUVProcessChain: Simplify builder initialization
d32c30906a Tests: Add missing include in testUVProcessChainHelper on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9181
2024-01-25 10:40:02 -05:00
Brad King
b6e4e4babc cmUVProcessChain: Simplify SetExternalStream usage
It is commonly called with the `fileno()` of a `FILE*` stream,
so accept the latter directly.
2024-01-24 16:59:49 -05:00
Brad King
d9d9326e14 Source: Avoid out-of-range inputs to std::isspace()
`isspace` takes `int` but documents that the value must be representable
by `unsigned char`, or be EOF.  Use a wrapper to cast to `unsigned char`
to avoid sign extension while converting to `int`.  This generalizes the
fix from commit 5e8c176e2a (cmExecuteProcessCommand: Cast c to unsigned
char before cast to int, 2024-01-05) to other `isspace` call sites.

This was detected by assertions in the MSVC standard library while
processing UTF-8 text.

Issue: #25561
2024-01-17 10:17:06 -05:00
Matthew Woehlke
20adf8cfce ctest: allow HTTP headers via command line
Add ability to specify HTTP headers via `ctest -T Submit`.
2024-01-08 14:11:40 -05:00
Brad King
80fe56c481 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.
2023-12-03 08:30:07 -05:00
Brad King
5396f4a9a3 cmUVJobServerClient: Add libuv-based job server integration client 2023-12-03 08:30:06 -05:00
Brad King
0432b921ae cmCTestMultiProcessHandler: Inline removal of pending test as it starts
Avoid searching the entire list of ordered pending tests to remove one
when we already know where it is.
2023-11-22 07:49:04 -05:00
Brad King
b17c732e88 cmCTestMultiProcessHandler: Clarify role of StartTestProcess
Focus its role on actually running the test process.
Move administrative tasks to the call site.
2023-11-22 07:49:04 -05:00
Brad King
0950acb337 cmCTestMultiProcessHandler: Manage concurrency slots with other resources 2023-11-22 07:49:04 -05:00
Brad King
697900da29 cmCTestMultiProcessHandler: Manage affinity assignments with other resources 2023-11-22 07:49:04 -05:00
Brad King
086a41c0f3 cmCTestMultiProcessHandler: Simplify test startup batching
Once a test is ready to run, count it against the number of tests to
start in the current batch whether or not the test process actually
starts successfully.  If a test process does fail to start, simply
schedule a new startup batch on the next loop iteration.
2023-11-21 12:40:13 -05:00
Brad King
e528cd795f cmCTestMultiProcessHandler: Start new tests asynchronously
When a test finishes, defer starting new tests until the next loop
iteration.  That way, if multiple tests finish in a single loop
iteration, we can free all of their resources first, and then start
a new batch of tests.
2023-11-21 12:37:53 -05:00
Brad King
9d8415c17b cmCTestMultiProcessHandler: Clarify test-load retry timer infrastructure 2023-11-21 12:37:41 -05:00
Brad King
61e98ca33b cmCTestMultiProcessHandler: Factor out loop startup and teardown 2023-11-21 12:37:31 -05:00
Brad King
5ff0b4ed57 cmCTestMultiProcessHandler: Consolidate test readiness checks 2023-11-21 12:36:31 -05:00
Brad King
ad3df3ce4d cmCTestMultiProcessHandler: Exclude dependent tests earlier
Tests with unfinished dependencies should not be considered at all when
looking for tests that fit within the load and concurrency limits.
2023-11-21 08:29:17 -05:00