Commit Graph

1984 Commits

Author SHA1 Message Date
Zack Galbreath a6d4a9a2ae ctest: Include cmake instrumentation data in XML files 2025-02-15 06:25:12 -05:00
Zack Galbreath 85a63143ed instrument: don't report target=TARGET_NAME
Remove the erroneous default target name when instrumenting
custom commands.
2025-02-15 06:21:58 -05:00
Martin Duffy 9689155a05 instrumentation: Add Config value to snippet data 2025-02-09 12:29:09 -05:00
Brad King 7065e7a555 Merge topic 'instrumentation-build-hooks'
2680f30caf instrumentation: Allow multiple CALLBACK arguments
fc1d55f6a5 instrumentation: Add preBuild and postBuild hooks for ninja
f62a4ab2ee instrumentation: Refactor cmInstrumentation constructor and usage
c57d1752d4 cmUVProcessChain: Add Detached option for spawning daemons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10230
2025-02-05 09:08:33 -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
Brad King bc093eefab Merge topic 'ctest-subprocess'
cb5f136c66 ctest: Prevent infinite loop in ctest_run_script(NEW_PROCESS)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10286
2025-02-05 09:03:08 -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 b0e92f4a70 cmCTestConfigureCommand: Remove handler usage 2025-02-04 15:59:50 +01:00
Daniel Pfeifer c78d714ecc cmCTestConfigureCommand: Refactor command execution 2025-02-04 15:59:50 +01:00
Daniel Pfeifer e52eada2c2 cmCTestConfigureCommand: Refactor command line construction 2025-02-04 15:59:50 +01:00
Daniel Pfeifer fda055c260 cmCTestConfigureHandler: Move class into cmCTestConfigureCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2025-02-04 15:57:39 +01: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
Brad King 568a9795a6 Merge topic 'ci-fedora41-dnf-cache'
f398a517be ci: Update to rebuilt Fedora base images
e9fb64f3b7 Source: Drop incorrect class documentation that had typos
2844296c7b FindMPI: Fix typo in comment
72cce810ce ci(fedora41-hip): update the image in sync w/ `fedora41`
fa08bd803d ci(fedora41): refactor tests removal from Python packages
0e5159656a ci(fedora41): split install prerequisites and build for Rust packages
88c5cf809a ci(fedora41): split install prerequisites and build RBEnv into separate phases
86e96322eb ci(fedora41): tune RVM build to speedup and minimize the final image
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10283
2025-02-04 09:00:59 -05:00
Brad King e9fb64f3b7 Source: Drop incorrect class documentation that had typos 2025-02-03 12:03:07 -05:00
Martin Duffy f62a4ab2ee instrumentation: Refactor cmInstrumentation constructor and usage
Creates a global cmInstrumentation pointer on the CMake Instance to
prevent creating multiple instrumentation objects.
2025-02-03 10:10:06 -05:00
Martin Duffy d2a3d596d6 instrumentation: Fix expected location of Labels when using CTest launchers 2025-01-30 14:07:49 -05: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
Kitware Robot b2ba64add9 Revise C++ coding style using clang-format-18
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  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.

Fixes: #26123
2025-01-23 11:43:06 -05:00
Brad King 1d4d4362d9 Merge topic 'remove-old-compatibility'
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
2025-01-23 09:36:59 -05:00
Brad King 789a7d73d4 CMP0061: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Alex Turbov c3777c1536 ci: Extend spellcheck job with 'typos' tool
Unlike the `codespell`, `typos` is capable of finding typos
in combined identifiers (`CamelCase` or `snake_case`).
2025-01-22 08:51:45 -05:00
Martin Duffy 9d34069ca8 instrumentation: Add targetLabels field to link snippets
Adds a new data field `targetLabels` to link snippets which contains a list of
text labels from the LABELS target property.
2025-01-17 11:07:30 -05:00
Brad King 8018f2a6c4 Merge topic 'instrumentation'
097d4fd1b5 instrumentation: Collect and record project build system metrics
8a3c195188 Tests/RunCMake: Add RunCMake_CHECK_ONLY Option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9791
2025-01-16 08:55:25 -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
Brad King 66ba4fcae7 Merge topic 'ctest-cost-test-name-fix'
040da7d832 ctest: Allow arbitrary characters in test names of CTestCostData.txt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10161
2025-01-13 11:45:17 -05:00
John Drouhard 040da7d832 ctest: Allow arbitrary characters in test names of CTestCostData.txt
This changes the way lines in CTestCostData.txt are parsed to allow for
spaces in the test name.

It does so by looking for space characters from the end; and once two
have been found, assumes everything from the beginning up to that
second-to-last-space is the test name.

Additionally, parsing the file should be much more efficient since there
is no string or vector heap allocation per line. The std::string used by
the parse function to convert the int and float should be within most
standard libraries' small string optimization.

Fixes: #26594
2025-01-10 13:05:29 -06:00
Tim Blechmann 339c2b886a cmSystemTools: Add RandomNumber method that avoid re-seeding from OS
When profiling Qt builds on macos, about 2.2% of a `cmake` invocation
was spent reading from `/dev/urandom`.  Use a (thread)local rng to
mitigate this cost, particularly in `cmGeneratedFileStreamBase::Open`.
2025-01-09 11:17:20 -05:00
Martin Duffy fcbc883fa3 cmake: Allow configuration of default script names
Adds the ``--project-file`` command-line option to modify the default script
name loaded by CMake and ``add_subdirectory`` to values other than
``CMakeLists.txt``.

Fixes: #21570
2024-12-17 12:47:02 -05:00
Brad King 7b041f7fe8 ctest: Print GENERATED_RESOURCE_SPEC_FILE property in show-only output
This was missed in commit c8c1dd0d95 (CTest: Add ability to dynamically
generate resource spec file, 2023-07-20, v3.28.0-rc1~233^2).
2024-11-25 14:18:07 -05:00
Brad King 733808150b ctest: Print custom timeout signal properties in show-only output
This was missed in commit 54c5654f7d (ctest: Optionally terminate tests
with a custom signal on timeout, 2023-05-11, v3.27.0-rc1~18^2).
2024-11-25 14:17:34 -05:00
Daniel Pfeifer 9c23f8ed26 cmCTestUpdateCommand: Remove handler usage 2024-11-13 10:54:57 +01:00
Daniel Pfeifer 255b1af5af cmCTestUpdateHandler: Move class into cmCTestUpdateCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2024-11-13 10:39:44 +01:00
Daniel Pfeifer 2b052ad5ca cmCTestUploadCommand: Remove handler usage 2024-11-05 10:20:12 +01:00
Daniel Pfeifer db3ccdce41 cmCTestUploadHandler: Move class into cmCTestUploadCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer 8768a0c6e1 cmCTest*Command: Port away from cmCommand
Copy the necessary parts, but remove cloning and make all commands
immutable.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer c98ed10d0f cmCTest*Command: Declare member functions const 2024-11-05 10:20:12 +01:00
Daniel Pfeifer 0e995d4897 cmCTest*Command: Direct use of cmExecutionStatus
Make sure that getting Makefile and setting Error is both done
through a `status` argument rather than through `cmCommand`.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer 26a697f7c1 cmCTest*Command: Access Makefile through an alias
At the top of each function that requires access to Makefile,
declare an alias `mf = this->Makefile`.  Then replace all occurrences
of `this->Makefile->` with `mf.`.  The intention is to make following
changes easier to review.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer caa449493b cmCTest*Command: Fortify argument parsing
Fix tests that pass `CDASH_UPLOAD` or `SCHEDULE_RANDOM` without an argument.
2024-11-05 10:20:12 +01:00
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