Commit Graph

787 Commits

Author SHA1 Message Date
Brad King 4e5c2aadb1 libarchive: Rename cm_get_date wrapper to cm_parse_date
libarchive 3.8.0 renamed `__archive_get_date` to `archive_parse_date`.
2025-09-26 16:40:12 -04:00
Sergiu Deitsch 7040406f86 cmListFileLexer: Do not require null-terminated input 2025-09-12 18:28:55 +02:00
Tyler Yankee fbb5b47fbf instrumentation: Rename postTest and postInstall hooks
`postCTest` and `postCMakeInstall` are more closely aligned with the
corresponding snippets which cause cause them to trigger (`ctest` and
`cmakeInstall`, respectively), and as such serve as better indicators of
their true behavior.
2025-09-04 12:39:39 -04:00
Brad King d84e4dd621 Merge topic 'ctest-T-test-timeout'
9dc3edbba8 ctest: Restore default test timeout for command-line `-T Test` step
8745e6308e ctest: Restore default of no time limit for command-line `-T Test` step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11094
2025-08-20 10:01:02 -04:00
Brad King 9dc3edbba8 ctest: Restore default test timeout for command-line -T Test step
In commit 774fcbe49c (CTest: Base command line mode on top of scripting
commands, 2024-10-05, v4.0.0-rc1~653^2) the implementation of this step
was converted to use `ctest_test` internally.  That command has its own
default test timeout of 600s if the ctest "TimeOut" configuration value
is not set.  If "TimeOut" is not set then default it to our previous
command-line mode default test timeout.

Fixes: #27139
2025-08-18 14:30:56 -04:00
Brad King 8745e6308e ctest: Restore default of no time limit for command-line -T Test step
Refactoring in commit 83845184db (cmCTest: Move timing functions from
cmCTestScriptHandler to cmCTest, 2024-10-23, v4.0.0-rc1~576^2) enabled a
time limit even if the undocumented `CTEST_TIME_LIMIT` script variable
is not set.
2025-08-18 14:10:15 -04:00
Martin Duffy 9dec460c8c instrumentation: Store CDash settings in query files
Adds new `cdashSubmit` and `cdashVerbose` options to allow enabling
instrumentation in CDash submissions using query files or the
`cmake_instrumentation` command.

Fixes: #26783, #26727
2025-07-14 15:44:52 -04:00
Daniel Pfeifer 2aa2c9af97 ctest: Don't modify build and site names
CTest currently removes non-filename characters from CTEST_SITE and
CTEST_BUILDNAME in an inconsistent way, which leads to unconnected
information on CDash.  Non-filename characters actually don't cause
any issue in CDash at all, nor are they invalid XML.  The only place
where removing them may be needed is when an actual filename is
constructed.

Remove the filtering from the SafeBuildIdField function and place
it where a filename is constructed.
2025-06-28 11:39:42 +02:00
Brad King 0b61a17c93 ctest: Enable color output on Windows Consoles supporting VT100 escapes
Extend commit ffdec37a19 (CTest: Add colored output on tests summary
where supported, 2018-11-07, v3.14.0-rc1~384^2) to enable color on
Windows.

Issue: #26924
2025-05-22 13:12:41 -04:00
Brad King 458664a727 cmCTest: Avoid dependence on curl for non-network operation
Use the date parser from libarchive instead.

Issue: #26930
2025-05-15 10:59:51 -04:00
Brad King d7990d20b5 cmCTest: Clarify nightly start time construction logic 2025-05-15 10:59:51 -04:00
Zack Galbreath 2df19bec2b instrumentation: include output sizes in CTest XML 2025-04-24 11:39:45 -04:00
Brad King b4b0d3f118 cmDynamicLoader: Remove unused code
It has not been used since commit dc0c6734d3 (CMP0031: Remove support
for OLD load_command command, 2024-11-26, v4.0.0-rc1~174^2~21).
2025-04-21 19:36:26 -04:00
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
Brad King 2604f5d8b3 Merge topic 'json-errors-filename'
f134468a98 JSON: Improve JSON error message formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10463
2025-03-14 12:17:02 -04:00
Martin Duffy f134468a98 JSON: Improve JSON error message formatting
This improves the output of JSON-related error messages. It adds the filename to
the output and excludes the column number.

This is particularly useful when there are multiple JSON files being read that
could be responsible for an error, ie CMakePresets.json and
CMakeUserPresets.json, or multiple instrumentation queries.

Issue: #26717
2025-03-13 10:44:31 -04:00
Daniel Pfeifer 712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
Since commit 774fcbe49c (CTest: Base command line mode on top of
scripting commands, 2024-10-05, v4.0.0-rc1~653^2) we drive dashboard
client steps through `cmCTestHandlerCommand::ExecuteHandlerCommand`
instead of calling `ProcessHandler` directly.  This requires the
`BuildDirectory` to be known to establish a work directory.

Fixes: #26743
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-06 09:43:22 -05: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
Brad King f54699d31d cmCTest: De-duplicate working directory code 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 45d3ffaa95 instrumentation: Use auto for variables holding closures 2025-02-17 11:08:30 -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
Brad King 5723863444 Merge topic 'ctest-configure-refactoring'
b0e92f4a70 cmCTestConfigureCommand: Remove handler usage
c78d714ecc cmCTestConfigureCommand: Refactor command execution
e52eada2c2 cmCTestConfigureCommand: Refactor command line construction
fda055c260 cmCTestConfigureHandler: Move class into cmCTestConfigureCommand.cxx
509b2cca66 cmCTest: Extract utility functions from cmCTestGenericHandler
8d4743b9e9 cmCTestBuildHandler: Store path of temporary log file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10253
2025-02-05 09:05:23 -05:00
Nikita Nemkin cb5f136c66 ctest: Prevent infinite loop in ctest_run_script(NEW_PROCESS)
ctest passes an internal -SR argument to inform a subprocess which
script to run. Because all arguments are propagated to the subprocess,
nested subprocess receives multiple -SR arguments and re-runs
the parent script in addition to its own, leading to a loop.

Ignore redundant -SR arguments on input and also filter out parent's
-SR argument when constructing a child process.

Fixes: #8837
2025-02-04 20:19:10 +05:00
Daniel Pfeifer 509b2cca66 cmCTest: Extract utility functions from cmCTestGenericHandler 2025-02-04 15:57:38 +01:00
Daniel Pfeifer 8d4743b9e9 cmCTestBuildHandler: Store path of temporary log file 2025-02-04 15:57:38 +01:00
Alex Turbov d34971f455 Refactor: Eliminate redundant std::to_string as arg of cmStrCat
Plus optimize some other string operations in the modified files.
2025-01-26 04:03:38 +04: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
Martin Duffy 097d4fd1b5 instrumentation: Collect and record project build system metrics
Add a feature for collecting build instrumentation for CMake projects.

Issue: #26099
2025-01-15 09:16:50 -05:00
Daniel Pfeifer 9c23f8ed26 cmCTestUpdateCommand: Remove handler usage 2024-11-13 10:54:57 +01:00
Brad King 384dbef61e Merge topic 'normalize-input-paths'
799602b983 cmQtAutoMocUic: Remove now-unnecessary mutex around CollapseFullPath
5ca6234d13 KWSys: Remove path translation map settings for build within CMake
74c497ca65 Merge branch 'upstream-KWSys' into normalize-input-paths
10a381e446 KWSys 2024-11-04 (bef1f021)
73dddffe32 KWSys: Disable the path translation map for build within CMake
b378781c5d cmSystemTools: Cache ToNormalizedPathOnDisk actual-case lookups
622596c6b2 cmSystemTools: Re-implement ToNormalizedPathOnDisk without translation map
5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9969
2024-11-04 10:09:16 -05:00
Brad King 5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory
Track the current working directory with symbolic links preserved.
2024-11-03 08:26:36 -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 70dfb24957 cmCTestTestHandler: Consolidate simple options into cmCTestTestOptions 2024-10-29 11:26:54 +01:00
Daniel Pfeifer b43d3dcfba cmCTestTestHandler: Consolidate File options into cmCTestTestOptions 2024-10-29 11:26:27 +01:00
Daniel Pfeifer f7181175ad cmCTestTestHandler: Consolidate RegExp options into cmCTestTestOptions 2024-10-29 11:25:57 +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 f5a314cc35 cmCTestGenericHandler: Add cmCTest* argument to Initialize function 2024-10-23 23:42:14 +02:00
Daniel Pfeifer 66460dc4d7 cmCTest: Cleanup ReadCustomConfigurationFileTree function 2024-10-23 23:22:05 +02:00
Daniel Pfeifer 812f8cce5a cmCTest: Cleanup PopulateCustomVectors calls
In `ExecuteTests`, call `PopulateCustomVectors` on the test handler.
in script mode, `cmCTestHandlerCommand::InitialPass` already calls
the function on the handler before processing it.  Hence, calling
the function all handlers in `ReadCustomConfigurationFileTree` is
no longer necessary and can be removed.
2024-10-23 14:49:55 +02:00
Daniel Pfeifer e279ba06dc cmCTest: Inline InitializeTesting at its call site 2024-10-23 14:49:55 +02:00
Brad King 074ad98ebc ctest: Explicitly normalize input paths as they exist on disk 2024-10-22 13:26:12 -04:00