Commit Graph

219 Commits

Author SHA1 Message Date
Daniel Pfeifer
281e9039cb cmWorkingDirectory: Unify error messages 2024-10-18 15:04:07 -04:00
Daniel Pfeifer
58c5f77837 clang-tidy: fix readability-redundant-* warnings 2024-10-11 15:37:21 +02: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
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
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
Daniel Sim
06860d5c12 ctest: Show custom test properties in --show-only=json-v1 2024-03-06 15:06:20 +00:00
Kyle Edwards
b9bfd411cb CTest: Throw error if resource spec is invalid 2024-02-08 09:02:33 -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
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
Brad King
3c4767f467 cmCTestTestHandler: Clarify name of member storing RESOURCE_LOCK property
The property represents project-defined resources.
2023-11-21 08:29:17 -05:00
Brad King
6818925b9a Merge topic 'ctest-cleanup'
5d2e93f9e8 cmCTestMultiProcessHandler: Simplify logic on unavailable resources
a4b061a035 cmCTestMultiProcessHandler: Clarify resource availability error member names
1487e540aa cmCTestMultiProcessHandler: Reduce repeat test property map lookups
b02b628ad9 cmCTestMultiProcessHandler: Simplify loop termination on serial test
8f1e8af0cc cmCTestMultiProcessHandler: Stop searching for tests when limit is reached
bd0b4ca867 cmCTestMultiProcessHandler: Invert spare load condition
9b548139fd cmCTestMultiProcessHandler: Clarify search for tests <= concurrency limit
ee321dc85f cmCTestMultiProcessHandler: Clarify search for tests <= spare load
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8981
2023-11-20 08:16:19 -05:00
Brad King
5d2e93f9e8 cmCTestMultiProcessHandler: Simplify logic on unavailable resources
Deallocation is not necessary after allocation fails.
2023-11-17 18:43:01 -05:00
Brad King
a4b061a035 cmCTestMultiProcessHandler: Clarify resource availability error member names
The members are about the availability of sufficient resources,
not allocation of them.
2023-11-17 18:43:01 -05:00
Brad King
1487e540aa cmCTestMultiProcessHandler: Reduce repeat test property map lookups 2023-11-17 18:43:01 -05:00
Brad King
b02b628ad9 cmCTestMultiProcessHandler: Simplify loop termination on serial test 2023-11-17 18:43:01 -05:00
Brad King
8f1e8af0cc cmCTestMultiProcessHandler: Stop searching for tests when limit is reached
Avoid an extra loop iteration if we have no room for more tests.
2023-11-17 18:42:17 -05:00
Brad King
bd0b4ca867 cmCTestMultiProcessHandler: Invert spare load condition
Switch then/else blocks to reduce indentation.
2023-11-17 18:41:42 -05:00
Brad King
9b548139fd cmCTestMultiProcessHandler: Clarify search for tests <= concurrency limit 2023-11-17 18:41:42 -05:00
Brad King
ee321dc85f cmCTestMultiProcessHandler: Clarify search for tests <= spare load
Move code into conditions where it is needed and comment its purpose.
2023-11-17 18:41:42 -05:00
Brad King
afd185881f cmCTestMultiProcessHandler: Make loops over all pending tests more consistent
Some loops were using the ordered list unnecessarily while others used
the main map of pending test.  Update all to use the latter.
2023-11-17 18:41:41 -05:00
Brad King
3bc3f6cbb5 cmCTestMultiProcessHandler: Clarify representation of pending test order
Also avoid copying the entire list each time we start a batch of tests.
2023-11-17 18:41:41 -05:00
Brad King
b27969c89d cmCTestMultiProcessHandler: Clarify representation of pending tests 2023-11-17 18:41:41 -05:00
Brad King
7bca3f8c80 cmCTestMultiProcessHandler: Avoid extra copy of test maps 2023-11-17 18:41:41 -05:00
Brad King
d6d114f3e8 cmCTestMultiProcessHandler: Remove unused members
The `TestRunningMap` and `TestFinishMap` members have not been used
since commit 44017a4767 (CTest: handle dependent and non dependent test
requirements equally, 2013-10-17, v3.0.0-rc1~451^2~7).
2023-11-17 18:41:41 -05:00
Brad King
451429e19c cmCTestMultiProcessHandler: Use cm::uv_loop_ptr abstraction
This ensures all loop resources are released.
2023-11-17 18:41:41 -05:00
John Parent
419443f68f cmCTestMultiProcessHandler: Factor out helper to check for completion 2023-11-17 18:41:41 -05:00
Chris Mahoney
8c307ab567 cmCTestMultiProcessHandler: Replace false condition with opposite assert 2023-11-17 18:41:41 -05:00
Brad King
1f8f270f62 cmCTestRunTest: Consolidate initialization in constructor 2023-11-17 18:41:40 -05:00
Brad King
6ef03ca03e cmUVSignalHackRAII: Drop outdated and unused libuv SA_RESTART workaround
It is only needed for libuv < 1.19, but since commit c050d6a01e
(string(TIMESTAMP): add %f specifier for microseconds, 2022-01-27,
v3.23.0-rc1~59^2) we require libuv >= 1.28.
2023-11-17 08:49:21 -05:00
Kyle Edwards
c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
Issue: #25106
2023-08-10 16:47:51 -04:00
Kyle Edwards
3f5a5a5856 cmCTestRunTest::StartFailure(): Add total argument
This function was being called when TotalNumberOfTests hadn't been
initialized, resulting in undefined output. It's not clear why this
was never apparent until now. Accept a total argument to ensure it's
initialized.
2023-08-10 16:46:25 -04:00
Brad King
e38c05688e CTest/cmProcess: Adopt field tracking reason for the process timeout
A test process may timeout either because the test timeout was reached,
or the overall stop time was reached.  Shorten the lifetime for which
we track this state in `cmCTestRunTest`.
2023-05-31 09:43:03 -04:00
Brad King
0a5aeaf302 cmCTestRunTest: Consolidate test timeout selection logic
Test timeout selection was previously spread out over several locations.
Consolidate it in a single place to make it easier to follow.
2023-05-04 17:11:19 -04:00
Brad King
75e8173322 Source: Fix clang -Wunused-but-set-variable warnings 2022-04-06 16:02:05 -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
Brad King
82e40607a4 ctest: Display test "WAITING" messages only in extra-verbose mode
These messages are incidental scheduling output.  Avoid cluttering
the normal verbose output showing tests starting and finishing.
2021-04-06 14:48:14 -04:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00