Commit Graph

760 Commits

Author SHA1 Message Date
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
Brad King 4b08b10900 Merge topic 'ctest-init'
80d6b20657 cmCTestStartCommand: Remove data members
0bfe17e15b cmCTest: Separate initialization of script and command line
402af107a5 cmCTest: Add GetTestGroupString function
37651800ed cmCTest: Extract functions CreateNewTag and ReadExistingTag
d28947913c cmCTest: Separate InitializeTesting function
60b822da52 cmCTest: Function ReadCustomConfigurationFileTree never fails
3c321b6571 cmCTestStartCommand: Inline InitializeFromCommand function
9fbdfa11d4 cmCTest: Separate test execution from dashboard mode
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9911
2024-10-21 09:43:25 -04: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 9fbdfa11d4 cmCTest: Separate test execution from dashboard mode 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 2a5ecbdf1a ctest: Restore cleanup of load_command plugins
Restore `cmDynamicLoader` cleanup removed by commit c7d11a77e4 (ctest:
Remove outdated optimization of tests running ctest itself, 2024-10-16).
2024-10-18 07:43:18 -04:00
Brad King 41fce4140d ctest: Drop --build-and-test cmake output buffering
Issue: #25790
2024-10-17 08:37:12 -04: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 38ad939383 cmCTest: Fix clang-tidy performance-unnecessary-copy-initialization diagnostic 2024-10-16 14:12:58 -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 97b95f24fd cmCTest: Simplify log flushing 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