Commit Graph

284 Commits

Author SHA1 Message Date
Daniel Goldberg
d3455f38de ctest: Add option to specify the --schedule-random seed
When `--schedule-random` is used in automated CI jobs, failures may
occur due to test order.  We now log the seed.  Provide a way for
developers to re-run the same order by specifying the seed.

Fixes: #26760
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-18 14:17:59 -04:00
Daniel Pfeifer
e47dc29967 cmCTestStartCommand: Remove unnecessary code
We called `UpdateCTestConfiguration` but set an internal option
that made it a no-op.  Instead, just do not call it.
2025-03-06 09:43:22 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Martin Duffy
a2232db802 instrumentation: Make hooks compatible with presets 2025-02-17 11:03:28 -05:00
Zack Galbreath
a6d4a9a2ae ctest: Include cmake instrumentation data in XML files 2025-02-15 06:25:12 -05:00
Daniel Pfeifer
509b2cca66
cmCTest: Extract utility functions from cmCTestGenericHandler 2025-02-04 15:57:38 +01:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Dylan Snelgrove
0a4ee422c1 ctest: Restore Windows Error Reporting in interactive mode
This behavior was removed when we switched to libuv in CMake 3.11.
After backporting new changes from libuv v2, we can restore the
behavior.

Fixes: #20115
2024-11-01 09:56:54 -04:00
Daniel Pfeifer
d07a35a336 cmCTest: Remove handler instances 2024-10-29 12:49:22 +01:00
Daniel Pfeifer
b64e59d571 cmCTestSubmitHandler: Initialize HttpHeaders with command line 2024-10-29 12:49:22 +01:00
Daniel Pfeifer
81e904bd53 cmCTestScriptHandler: Don't inherit from cmCTestGenericHandler
Add `cmake*` and `cmCTest*` instances and arguments where needed,
such that `GetScriptHandler` does not have to be called.
2024-10-29 12:47:41 +01:00
Daniel Pfeifer
914a355810 CTest: Remove unneeded code 2024-10-29 11:27:17 +01:00
Daniel Pfeifer
86225833f2 cmCTestTestHandler: Consolidate Output options into cmCTestTestOptions 2024-10-29 11:25:05 +01:00
Daniel Pfeifer
23c6de8808 cmCTestGenericHandler: Initialize SubmitIndex and Verbose 2024-10-29 11:18:48 +01:00
Brad King
65c1147e6c Merge topic 'ctest-timing'
83845184db cmCTest: Move timing functions from cmCTestScriptHandler to cmCTest

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9936
2024-10-25 08:28:43 -04:00
Daniel Pfeifer
83845184db cmCTest: Move timing functions from cmCTestScriptHandler to cmCTest 2024-10-24 00:06:31 +02:00
Daniel Pfeifer
e279ba06dc cmCTest: Inline InitializeTesting at its call site 2024-10-23 14:49:55 +02:00
Daniel Pfeifer
80d6b20657 cmCTestStartCommand: Remove data members 2024-10-19 14:38:03 -04:00
Daniel Pfeifer
0bfe17e15b cmCTest: Separate initialization of script and command line 2024-10-19 14:38:03 -04:00
Daniel Pfeifer
402af107a5 cmCTest: Add GetTestGroupString function
Rename the current GetTestModelString to GetTestGroupString, because
that is what the function actually returns.  Then add a new function
GetTestGroupString that actually returns the model.
2024-10-19 14:38:02 -04:00
Daniel Pfeifer
37651800ed cmCTest: Extract functions CreateNewTag and ReadExistingTag 2024-10-19 14:37:40 -04:00
Daniel Pfeifer
d28947913c cmCTest: Separate InitializeTesting function 2024-10-18 15:04:08 -04:00
Daniel Pfeifer
60b822da52 cmCTest: Function ReadCustomConfigurationFileTree never fails 2024-10-18 15:04:08 -04:00
Daniel Pfeifer
3c321b6571 cmCTestStartCommand: Inline InitializeFromCommand function 2024-10-18 15:04:08 -04:00
Daniel Pfeifer
281e9039cb cmWorkingDirectory: Unify error messages 2024-10-18 15:04:07 -04:00
Daniel Pfeifer
c8bae4e226 cmCTest: Remove Finalize function 2024-10-18 17:10:16 +02:00
Daniel Pfeifer
7e4b26fdb1 cmCTest: Extract RunScripts function 2024-10-18 17:10:16 +02:00
Brad King
79428efce0 cmCTestBuildAndTest: Adopt RunTest method
The method is now specific to this class.
2024-10-16 14:14:04 -04:00
Brad King
c7d11a77e4 ctest: Remove outdated optimization of tests running ctest itself
In commit 2c2291bbe0 (ENH: add new feature to ctest so that it can
cmake, build and run a test executable, 2004-01-07, v2.4.0~3483) ctest
was taught to recognize tests that run ctest itself and run them
internally instead of spawning a new process.  This optimization was
removed by commit b9daa192af (ENH: Refactored CTest test execution code
into an object, 2009-08-19, v2.8.0~276) `cmCTestRunTest` replaced
`cmCTestTestHandler::ProcessOneTest`, which was eventually removed by
commit 5a5cc52230 (Fixed conversion warning on 64 bit machines,
2009-08-31, v2.8.0~241).  Since then the optimization was only left in
`--build-and-test` mode, likely by accident, where it makes little
difference.  Remove it to simplify the code.

Also drop the `--force-new-ctest-process` option, originally added by
commit 9255e40d81 (ENH: Add a way to force ctest to be a new process,
2004-05-10, v2.4.0~3101), since it no longer does anything.
2024-10-16 14:13:46 -04:00
Brad King
b2b7c4cc28 cmCTest: Remove unused functionality from RunTest method
`cmCTest::RunTest` has been used only for `--build-and-test` mode since
commit b9daa192af (ENH: Refactored CTest test execution code into an
object, 2009-08-19, v2.8.0~276).  Drop code needed only by its old role
of running tests.
2024-10-16 14:13:23 -04:00
Brad King
3d2882290b ctest: Split --build-and-test implementation from handler infrastructure
It does not follow the pattern of the dashboard-mode step handlers.
2024-10-15 11:59:51 -04:00
Brad King
f521d20cb4 Merge topic 'ctest-command-line'
c0c4d48ba2 cmCTest: Use cmCommandLineArgument command-line parsing infrastructure
67dc003467 cmCTest: Add missing const
9b09c3733a cmCTestBuildAndTestHandler: Simplify constructor
30ece11e66 cmCommandLineArgument: Do not treat negative numbers as flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9901
2024-10-15 10:42:30 -04:00
Brad King
c0c4d48ba2 cmCTest: Use cmCommandLineArgument command-line parsing infrastructure 2024-10-14 12:12:51 -04:00
Brad King
67dc003467 cmCTest: Add missing const 2024-10-14 10:52:59 -04:00
Brad King
8c622959e9 Merge topic 'ctest-core'
774fcbe49c CTest: Base command line mode on top of scripting commands
5115c01e1f CTestCommandLine tests: Make sure to test successful run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9881
2024-10-14 10:02:05 -04:00
Daniel Pfeifer
774fcbe49c CTest: Base command line mode on top of scripting commands
Make sure that all CMake variables that are translated into
CTest options in `cmCTest*Command` implementations are translated
from CTest options into CMake variables before the functions are
called.  This back-and-forth translation should be temporary.
It is a necessary prerequisite for refactoring `cmCTest*Handler`
implementations to operate on CMake variables directly rather
than CTest options.
2024-10-12 06:42:02 -04:00
Brad King
6fcb64d6b4 cmCTest: Reduce string copies during logging 2024-10-11 10:42:14 -04:00
Brad King
134df24ff1 cmCTest: Remove undocumented option to log internal line numbers 2024-10-11 10:42:14 -04:00
Brad King
24daa48a7d cmCTest: Strengthen log type enumeration 2024-10-11 10:42:14 -04:00
Brad King
c73215d922 cmCTest: Remove RunTest log argument not used by any caller 2024-10-11 10:41:44 -04:00
Daniel Pfeifer
267b42bccc CTest: Remove declarative scripting mode 2024-10-09 22:30:58 +02:00
Daniel Pfeifer
29db283ba7 CTest: remove cmCTestLogWrite helper 2024-08-02 00:14:57 +02:00
Jake D'Esposito
304396d13c ctest: Show error on invalid ctest arguments
Fixes: #24227
2024-04-03 21:33:19 -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
Kyle Edwards
b15ad7ebb6 cmCTest: Replace cmsysProcess with cmUVProcessChain 2023-08-29 10:51:30 -04:00
Vitaly Stakhovsky
0ee984defa CTest: Use std::string arguments 2023-01-03 07:49:22 -05:00
Kyle Edwards
bea4ed5430 CTest: Add support for outputJUnitFile in presets
Fixes: #22400
2022-10-18 16:52:23 -04:00
Zack Galbreath
cbcb92d1cb ctest: add support for attaching files to tests at run time
Allow tests to specify files to upload at runtime. Previously this was
only possible to specify at configure time with the ATTACHED_FILES
test properties.

This commit also fixes a bug in how our test data tarballs were generated
by CTest. Previously, if you tried to attach a file outside of the binary
directory, CTest would generate a tar file with a relative path, and tar
would not allow you to extract it. We resolve this problem by creating
tar files with a flat directory structure instead.

Fixes: #22284
2021-06-08 09:27:19 -04:00
Adriaan de Groot
44ad3f0b7f ctest: Support multiple -L and -LE options to mean "AND"
Fixes: #21087
2021-03-28 12:04:05 +11:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00