Commit Graph
995 Commits
Author SHA1 Message Date
Tyler Yankee 26e6188e04 Tests/Instrumentation: Split make cases out to separate suite
These tests experience frequent timeouts in CI, which are either actual
timeouts due to low resource runners, or a platform-specific bug
causing an indefinite hang. Either way, it's beneficial to locate these
in their own test suite to reduce noise and ensure the rest of the
tests pass regularly.
2026-07-30 11:14:48 -04:00
Daksh Mamodiya 899e7231ab CTest: Report failure when a launched command is killed by a signal
cmCTestLaunch, which backs ctest --launch and ctest --instrument,
derived its exit code from the child's SpawnResult and ExitStatus but
ignored TermSignal.  On POSIX a command killed by a signal reports
ExitStatus 0 and TermSignal N, so the launcher reported success for a
crashed or killed command, masking failed compile/link/custom rules on
the dashboard and in instrumentation snippets.

Classify the child with the ordered triple SpawnResult, TermSignal,
ExitStatus, mapping a signal-killed child to a non-zero exit code.
Native Windows is unaffected: abnormal termination already arrives as a
non-zero exit code there.

Fixes: #27921
2026-07-06 15:46:37 +02:00
Brad King df2bd0f771 Merge topic 'liblzma-arm64-bcj'
9a46155665 Tests: Cover ARM64 BCJ 7z extraction
8f94e20abc liblzma: Enable ARM64 BCJ filters in bundled build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12202
2026-06-25 07:27:33 -04:00
NihilDigit 9a46155665 Tests: Cover ARM64 BCJ 7z extraction
Add a small 7z fixture whose filter chain is ARM64 BCJ followed by
LZMA2.  This exercises extraction through CMake's bundled libarchive
and liblzma path.

The fixture was generated with 7-Zip 25.01 (arm64).  The payload is a
16-byte AArch64 instruction sequence:

  1f2003d500000094000000141f2003d5

The payload mtime was set to 2026-06-21T00:00:00Z and then archived
with:

  7z a -m0=ARM64 -m1=LZMA2 -mb0:1 -mtm=on -mtc=off -mta=off \
    7zip-arm64-bcj.7z payload.bin

The resulting 7zip-arm64-bcj.7z has SHA256:

  3DE9111E71C6AA3CBD604460040EBBE6F57E8B00D1D5C5343AC07D435AA2A8D2
2026-06-24 10:18:49 -04:00
Brad King 84e1dbc893 Merge topic 'fileapi-import-std-target-refs'
11c93dd6da fileapi: Test import std target references in codemodel

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12209
2026-06-24 09:52:25 -04:00
Brad King 4073b18ab7 Merge topic 'source_group-FILE_SET-support'
6043014d1d source_group(): Add file set support
44fd6ec551 source_group: use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12195
2026-06-24 09:49:49 -04:00
Brad King f98ff30970 Merge topic 'tests-split-runcmake-install'
e5e4616a56 Tests/RunCMake/install: split into variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12194
2026-06-24 09:36:28 -04:00
kkkzbh 11c93dd6da fileapi: Test import std target references in codemodel
Add a regression test for the File API codemodel graph produced for an
import std target. The test verifies that emitted target references,
including those to the CMake-provided stdlib target, resolve to targets
present in the codemodel.

Closes: #27890
2026-06-24 03:02:18 +08:00
Marc Chevrier 44fd6ec551 source_group: use cmArgumentParser
To facilite any future evolutions, use cmArgumentParser to
parse method arguments.
2026-06-23 13:45:39 +02:00
Ben Boeckel e5e4616a56 Tests/RunCMake/install: split into variants
To keep individual test times down.

Also rename some tests to be shorter named to avoid path length issues
on Windows.
2026-06-22 21:19:24 -04:00
Daksh Mamodiya bda67b82e7 instrumentation: Write cmakeBuild snippet when build is interrupted
The overall `cmakeBuild` snippet is written only after the native build
tool returns, so interrupting `cmake --build` with Ctrl+C terminated CMake
before it was recorded and lost the build's delineation.

When instrumentation is active, install a scoped, async-signal-safe handler
(POSIX SIGINT; Windows CTRL_C/CTRL_BREAK) that just flags the interrupt. The
existing write then runs during unwind, records the interrupting signal in a
new `interruptSignal` field, skips the post-build index hook, and re-raises so
the exit status still reflects the signal.

The handler lives in its own translation unit, keeping the platform-divergent
signal code out of the main instrumentation implementation.

Issue: #27859
2026-06-18 15:38:43 +02:00
Martin Duffy 0480222ff4 instrumentation: Add compileTrace option
Adds support for optionally saving and reporting trace files generated by
Clang's `-ftime-trace` option.
2026-06-10 15:19:41 -04:00
Brad King bd870ef98f Merge topic 'swift-sizeof-void-p'
a82e3e3aaf Swift: Verify setting sizeof_void_p
8682afd971 Swift: Extract pointer size from Swift compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12125
2026-06-02 09:27:23 -04:00
Brad King c07ac2b941 Merge topic 'macro-argument-escape'
9d2e85373a macro: Add policy to preserve backslashes in arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11734
2026-06-02 09:06:21 -04:00
Alex Reinking 9d2e85373a macro: Add policy to preserve backslashes in arguments
Preserve backslashes in arguments passed to macros by re-escaping
them before substituting in the macro body, where they will be
parsed again.

Fixes: #19281, #22157, #23641, #25803, #27645, #20891
2026-05-31 14:36:15 -04:00
Evan Wilde a82e3e3aaf Swift: Verify setting sizeof_void_p
Adding a test to verify that we are setting the data pointer size and
`CMAKE_SIZEOF_VOID_P` in a test that only enables Swift.
2026-05-29 15:15:46 -07:00
Brad King 4ce7fd4a04 Merge topic 'module-case-mismatch'
dadbb71492 include/find_package: Warn on case-mismatched module names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12094
2026-05-29 09:31:43 -04:00
Brad King 3cbe1d5a91 Merge topic 'cache-doc-lookup'
7fdf315ba3 cmake: Populate help string from documentation table for -D entries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12092
2026-05-29 09:25:13 -04:00
Daksh Mamodiya 7fdf315ba3 cmake: Populate help string from documentation table for -D entries
When a built-in cache variable is set via `-D <var>=<value>` with no
help text supplied, populate `HELPSTRING` from the built-in
documentation table (sourced from `Help/variable/*.rst` and the
per-language pattern manuals).  Project-defined and unknown variables
continue to receive the legacy "No help, variable specified on the
command line." sentinel.

The cache entry's type and value are left untouched: type stays
`UNINITIALIZED` for bare `-D` and an explicit `-D <var>:TYPE=<value>`
is honored as before.  The `cmCacheManager::LoadCache` path is not
modified, so reload of existing caches is a fixed point.

Fixes: #27830
2026-05-28 09:25:41 -04:00
Richard dadbb71492 include/find_package: Warn on case-mismatched module names
Detect when the requested module name differs in case from the module
filename on disk.  Emit an author warning on Windows and Apple
platforms, where case-insensitive lookup can hide portability problems
on case-sensitive filesystems.

Fixes: #27811
2026-05-28 08:57:59 -04:00
Brad King db63557d6a Merge topic 'skip-compiler-check-support'
11adb3b7ae Linker/Windows-MSVC: check for a non-empty linker version
32c12e6901 Modules/CMakeLANGCompiler.cmake.in: quote linker version and frontend variant
31946711d3 CMakeDetermineCompilerSupport: support skipping compiler feature checks
71d908010f Modules/DetermineCompiler: support skipping compiler checks
e267321f93 Modules/DetermineCompiler: avoid the cache for ABI compilations
94f4c64461 Tests/RunCMake/ToolchainSkipsChecks: add tests for skipping compiler checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11917
2026-05-26 16:12:35 -04:00
Brad King a5377e1985 Merge topic 'test-cxxmodules-split'
9da070b31f Tests/CXXModulesCompile: shorten `non-trivial-collation-order` tests
93449833ff RunCMake/CXXModulesCompile: split into 3 variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12098
2026-05-26 16:07:36 -04:00
Ben Boeckel 93449833ff RunCMake/CXXModulesCompile: split into 3 variants
The test was taking too long to run on all CI machines, so split into
three "variant" tests which take roughly the same amount of time.
2026-05-21 23:11:21 -04:00
Ben Boeckel 94f4c64461 Tests/RunCMake/ToolchainSkipsChecks: add tests for skipping compiler checks
There is interest in being able to craft a toolchain file that skips all
(relatively expensive) `try_*` commands during compiler detection. Add
tests which:

- discover the toolchain for a language
- write a toolchain file using that knowledge
- add a test that uses the toolchain file
- verify that the toolchain file-using test performs no `try_*` commands
  by inspecting the configure log

There are also checks which use `execute_process`, but these are far
less expensive and not a worry at the moment.
2026-05-18 23:49:43 -04:00
Brad King 64fc2f8089 Merge topic 'ctest-llvm-cov'
a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
5494697ed1 Tests: Add case for llvm-cov usage by ctest command line modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12007
2026-05-12 10:32:10 -04:00
Joseph Snyder a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
If the CTEST_TEST_COVERAGE_TOOL is set to LLVM-COV, use the
`llvm-profdata --merge` functionality to collect the `.profraw` files
generated by running each test into a combined `.profdata` file.
This is the file that could be used to parse or display coverage
information for each test.

Issue: #26932
2026-05-11 11:33:41 -04:00
Brad King eb1a6e2169 Merge topic 'exe-check-find'
7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12025
2026-05-08 07:45:27 -04:00
Brad King 61680b3b44 Merge topic 'cmake-diagnostics-variables'
72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
be057c5a01 cmVariableWatch: Use enum for access type
cba542f32c cmake.cxx: Organize includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11948
2026-05-08 07:44:05 -04:00
scivision 7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture `execute_process` calls' `RESULT_VARIABLE`.

We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query.  I.e. this is a "safe" way to broadly protect
these scripts.

Issue: #27782
2026-05-07 13:36:36 -04:00
Matthew Woehlke 72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
Update documentation for aforementioned variables, as their use is
deprecated under the new diagnostic system. Introduce a policy which
reintroduces their use to control specific deprecation diagnostics if
the policy is not NEW.

Note that this means there is NO synchronization between the variables
and the new diagnostic state.
2026-05-07 11:07:27 -04:00
scivision 8d48d755f0 Tests: Add missing execute_process result checks 2026-05-06 11:16:36 -04:00
Marc Chevrier 5f63b3c6b1 Remove MACROS directory property
It did not always contain all macros.
We have `if(COMMAND)` now instead.

Add policy CMP0217 for compatibility.

Fixes: #27765
2026-04-29 16:43:04 +02:00
Marc Chevrier bc7d8bd26f FILE_SET: Add INDEPENDENT_FILES property for Ninja order dependency control
Fixes: #25370
2026-04-12 15:00:03 +02:00
Marc Chevrier 5c5b68f44e FILE_SET: Add support for the SOURCES type
Fixes: #27550
2026-03-31 09:49:59 +02:00
Daniel Pfeifer 4e34426fb3 TestDriver: Add '-N' option to print all tests 2026-03-26 10:36:22 -04:00
Daniel Pfeifer 969999fa9f discover_tests: Add tests 2026-03-26 10:36:21 -04:00
Brad King 75937a7f96 Merge topic 'ci-orangec'
552e1688f3 ci: Add OrangeC 7.0.7 nightly CI job
0e71175e6a Tests/ExternalProjectLocal: Fix example project compilation with OrangeC 7
d3c05d3037 Tests/RunCMake/CMP0119: Update for OrangeC 7

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11870
2026-03-26 10:29:26 -04:00
Brad King d3c05d3037 Tests/RunCMake/CMP0119: Update for OrangeC 7
The compiler no longer supports arbitrary source extensions,
even when the `-x $lang` flag is given.
2026-03-25 16:57:51 -04:00
AJIOB 97455c3d7e file: Add ARCHIVE_* options to specify pathname encoding
Issue: #26903
2026-03-24 14:07:21 -04:00
Tyler Yankee 858fdd426b add_custom_command: Disallow exe-suffixed targets in DEPENDS
Two targets whose names differ only in a `.exe` suffix create a
conflict when adding target- and file-level dependencies for a custom
command. Add CMP0212 to provide compatibility with the old behavior.

Issue: #27612
2026-03-23 09:50:46 -04:00
Brad King 671ada703b Merge topic 'cmake-diagnostics'
a78f356ed9 Diagnostics: Shorten type names
2b7ee7137b cmStateSnapshot: CanPop* should be const
a0612aeb5d Diagnostics: Add cmake_diagnostic command
e74fbb3d44 Diagnostics: Implement diagnostic stack
d80a38e524 cmMakefile: Use enumeration for policy scope

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11818
2026-03-20 08:44:26 -04:00
Matthew Woehlke a0612aeb5d Diagnostics: Add cmake_diagnostic command
Add command to manipulate the new diagnostic stack/state introduced in
the previous commit. Start adding documentation for the system as a
whole.
2026-03-19 11:29:44 -04:00
Brad King 40bcc1e9d5 On program startup in C locale, switch to UTF-8 charset if possible
The UTF-8 charset is a superset of the C locale's 7-bit ASCII charset.

Since commit d284ce2fd6 (Initialize character set encoding on program
startup, 2026-02-02, v4.3.0-rc1~40^2) we set a single locale globally.
We can handle archives with UTF-8 paths by running in a locale with a
UTF-8 charset.

Fixes: #25226
Issue: #26903
Issue: #27562
2026-03-13 09:28:12 -04:00
Brad King 942ec6308c Merge topic 'cmake-E-tar-encoding'
0c355dfcf7 tar: Use UTF-8 as a default encoding
21eb53e9eb tar: Add option to specify the encoding of archive pathnames
0435b76095 libarchive: Build with iconv to handle entry path encoding
24cb39e081 libarchive: Suppress upstream preference for MacPorts over macOS SDK
e07d0dacc9 cmArchiveWrite: Comment how we pass an entry pathname to libarchive
95040f37ed Tests/RunCMake/CommandLineTar: Improve formatting of error messages
e5c6c121c6 libarchive: Backport "Fix crash on failure to convert WCS/UTF-8 pathname"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11601
2026-03-12 13:58:40 -04:00
Brad King 647b075be0 Merge topic 'genex-TARGET_OBJECTS-SOURCE_FILES'
987e0af366 GenEx: Add `$<TARGET_OBJECTS:...>` option to filter on source files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11782
2026-03-11 13:17:00 -04:00
Alex Overchenko 21eb53e9eb tar: Add option to specify the encoding of archive pathnames
Use OEM by default for backward compatibility

Fixes: #26903
2026-03-11 08:44:44 +03:00
Kyle Edwards 987e0af366 GenEx: Add $<TARGET_OBJECTS:...> option to filter on source files
Fixes: #27675
2026-03-10 10:51:43 -04:00
Mickaël Germain da42e4ed20 cmGeneratorTarget: Add OBJC/OBJCXX support to header set verification
Extend header set verification to support Objective-C and Objective-C++.
The supported-language table grows to {"C", "CXX", "OBJC", "OBJCXX"}
and the lattice join is updated so OBJCXX is chosen when both CXX and
OBJC sources are present. GenerateStubForLanguage emits .m/.mm stubs
and the relevant OBJC/OBJCXX standard properties are copied to the
verification target.

Add OBJC/OBJCXX test cases conditioned on CMake_TEST_OBJC, isolated in
dedicated project files to avoid affecting language inference for
unrelated targets. Update property documentation and add a release note.
2026-03-10 09:22:28 -04:00
Brad King aa86ddc4df Merge topic 'FILE_SET-inspection-properties'
63775fe60f FILE_SET: add the support of properties for file set inspection
9696a44cd3 Sphinx: update infrastructure for File Set properties support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11732
2026-03-02 09:42:07 -05:00
Marc Chevrier 63775fe60f FILE_SET: add the support of properties for file set inspection 2026-02-28 13:46:57 +01:00