Commit Graph

1943 Commits

Author SHA1 Message Date
Daniel Pfeifer ff2ec0387a cmCTest*Command: Generalize argument parsing and checking
Move the instantiation of unparsed arguments as well as the `parser.Parse` call
behind an abstraction.  Merge checks on `captureCMakeError`.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer 4ffc408ed9 cmCTest*Command: Loosen coupling with cmArgumentParser
Instead of inheriting from `cmArgumentParser<void>` and binding arguments by
overriding `BindArguments`, define a struct for the arguments and instantiate
a static const parser in the `InitialPass` function of each command.  Pass the
argument struct down to all functions that need to access it.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer 1a2d453b94 cmCTest*Command: Access arguments through an alias
At the top of each function that requires access to arguments,
declare an alias `args = *this`.  Then access all arguments with
`args.` rather than `this->`.  The intention is to make following
changes easier to review.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer c1de0976f8 cmCTest*Command: Bring all classes to a uniform layout
Make sure that all classes have a public inherited constructor, protected
data members for the arguments, followed by other private virtual functions.
The intention is to make following changes to have a smaller diff.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer 73830f976a cmCTestBuildCommand: Remove GlobalGenerator member
The command object is cloned before each invocation.
The situation where the pointer is not null never occurs.
2024-11-05 10:08:23 +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 73dddffe32 KWSys: Disable the path translation map for build within CMake
It is about to be removed from KWSys.
2024-11-03 08:32:46 -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 9fe40b33e0 cmCTest*Handler: Use default member initialization 2024-10-29 12:49:22 +01: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 323638f573 Merge topic 'libuv-error-mode-backport'
0f515c2d26 libuv: win/spawn: add option to use parent process error mode
728f40d4bf libuv: win/spawn: allow exception through to OS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9931
2024-10-28 09:32:24 -04:00
Brad King 8779b1ad28 Merge branch 'backport-ci-fedora-41' into ci-fedora-41 2024-10-26 06:02:18 -04:00
Dylan Snelgrove 0f515c2d26 libuv: win/spawn: add option to use parent process error mode
Backport changes from libuv v2 commit `8ad246557a` (win,process: allow
users to configure child error mode, 2024-10-17) to add the
`UV_PROCESS_WINDOWS_USE_PARENT_ERROR_MODE` option.

Also use `UV_PROCESS_WINDOWS_USE_PARENT_ERROR_MODE` to keep
the behavior the same as before the option was added,
all child processes would be spawned the the parent's
error mode.

Issue: #20115
2024-10-25 08:51:45 -04:00
Brad King 7605228f5e codespell: Fix typos 2024-10-25 08:43:04 -04: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
Brad King 719376b0a6 Merge topic 'no-stringly-typed-variables'
5497eba1a0 CTestUpdate: Prefer concrete variables over map entries
8cac63814c CTestSubmit: Prefer concrete variables over map entries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9935
2024-10-25 08:27:43 -04:00
Brad King 5d48124044 Merge topic 'ctest-handler-refactoring-pre'
f5a314cc35 cmCTestGenericHandler: Add cmCTest* argument to Initialize function
20b35ef622 cmCTestBuildCommand: Make use of ProcessAdditionalValues
b3c01f70b5 ctest: Print documentation without creating a cmCTest instance
66460dc4d7 cmCTest: Cleanup ReadCustomConfigurationFileTree function
812f8cce5a cmCTest: Cleanup PopulateCustomVectors calls
e279ba06dc cmCTest: Inline InitializeTesting at its call site

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9934
2024-10-25 08:26:56 -04:00
Brad King bd51803761 Merge topic 'misc-refactoring'
788e5c1043 Tests: Add tests for `cmDocumentationFormatter::PrintFormatted()`
8c1a850c19 cmMessenger: Deduplicate `cmSystemTools::Message()` calls
9c118ae9d4 Refactor: `cmCPackGenerator::DisplayVerboseOutput()` unused arg
5fd795f975 MessageType: Add `UNDEFINED` enum item
a6cae9dbc4 cmMessageCommand: Rename+move `CheckingType` → `Message::CheckType`
bb9071e9e7 cmDocumentationFormatter.cxx: Move padding string creation out of loop
f40712fc10 cmTargetLinkLibrariesCommand: Optimize `ostream::operator<<` calls
1ffb746c92 cmGlobalGenerator.cxx: Optimize `ostream::operator<<` calls
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9920
2024-10-24 09:00:32 -04:00
Daniel Pfeifer 83845184db cmCTest: Move timing functions from cmCTestScriptHandler to cmCTest 2024-10-24 00:06:31 +02:00
Daniel Pfeifer 5497eba1a0 CTestUpdate: Prefer concrete variables over map entries 2024-10-23 23:52:47 +02:00
Daniel Pfeifer f5a314cc35 cmCTestGenericHandler: Add cmCTest* argument to Initialize function 2024-10-23 23:42:14 +02:00
Daniel Pfeifer 8cac63814c CTestSubmit: Prefer concrete variables over map entries 2024-10-23 23:37:30 +02:00
Daniel Pfeifer 20b35ef622 cmCTestBuildCommand: Make use of ProcessAdditionalValues 2024-10-23 23:22:05 +02:00
Brad King 074ad98ebc ctest: Explicitly normalize input paths as they exist on disk 2024-10-22 13:26:12 -04:00
Alex Turbov b6dbb0c28f cmCTestBuildAndTest.cxx: Optimize ostream::operator<< calls 2024-10-22 00:44:28 +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 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
Brad King 8e4fdafd0a cmCTestBuildAndTest: Improve RunCMake method return type 2024-10-18 07:43:15 -04:00
Brad King 249c679fb4 ctest: Drop --build-and-test test output buffering
Fixes: #25790
2024-10-17 08:37:13 -04:00
Brad King cb171bcc12 ctest: Drop --build-and-test build output buffering
Issue: #25790
2024-10-17 08:37:12 -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 b8f14c6c4d cmGlobalGenerator: Remove default Build method output mode
Clarify call sites by passing the output mode explicitly.
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 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 270ab612b9 cmCTestBuildAndTestHandler: Simplify RunCMakeAndTest signature
Since commit 1a165dc60d (ENH: Move the build-and-test code to a handler,
2005-06-03, v2.4.0~1632), factored RunCMakeAndTest out of cmCTest, its
argument has been unnecessary.  In commit e60e4dfc88
(cmWorkingDirectory: Check success of current dir changes, 2018-03-04,
v3.12.0-rc1~395^2~1) unnecessary branching was added based on the
argument.  Remove both the argument and branching.
2024-10-15 11:47:34 -04:00