007d7ea648 GoogleTest: Avoid extra call to set DISABLED test property in discovery
9a24c1e802 GoogleTest: Clear script content buffer on flush and flush less often
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9982
There's no need to check if flushing is needed after every command
is added to the variable holding the script content. It is enough to only
check once per test name. This simplifies the flushing logic, removing
the need for a separate flush_script() command. Previously, we were
not clearing the flushed script contents in all cases, but this is now
rigorously enforced at the one location where flushing is performed.
Also simplify the flushing of the list of test names, since that too doesn't
need a separate command. It is simpler and safer to handle that
directly inline where the one call to flush_tests_buffer() was
previously being made.
Fixes: #26431
Add a way to specify, in a portable way, to raise an error for any
warning during the link step. For that purpose, define:
* CMAKE_LINK_WARNING_AS_ERROR variable
* LINK_WARNING_AS_ERROR target property
Fixes: #25343
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
3b8b70fe72 macOS: Simplify logic converting CMAKE_OSX_SYSROOT to a path
c55c113076 macOS: Revert finding tools inside Xcode that are not in the PATH
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
9eb530842c Tests/RunCMake/CMakePresets: Do not forward empty CMAKE_MAKE_PROGRAM
7fb14e707d Tests/RunCMake/XcFramework: Use macosx SDK in all multi-arch macOS cases
70ff1f15fc Tests/CTestTest*: Detect compiler from environment
1faf60cffc Tests/FortranC: Handle empty CMAKE_OSX_SYSROOT
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: FX Coudert <fxcoudert@gmail.com>
Merge-request: !9977
- Introduce the `std::string Format(std:string)` method
- Simplify the algorithm to use `cmTokenizedView()` instead of pointers manipulation and slow iostreams
- Formatted text chunks are collected as a sequence of string views to join once at the end
2b052ad5ca cmCTestUploadCommand: Remove handler usage
db3ccdce41 cmCTestUploadHandler: Move class into cmCTestUploadCommand.cxx
1b8f9274b2 cmCommand: Remove
8768a0c6e1 cmCTest*Command: Port away from cmCommand
c98ed10d0f cmCTest*Command: Declare member functions const
0e995d4897 cmCTest*Command: Direct use of cmExecutionStatus
26a697f7c1 cmCTest*Command: Access Makefile through an alias
caa449493b cmCTest*Command: Fortify argument parsing
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9968
On modern macOS, compiler wrappers like `/usr/bin/cc` automatically
choose a SDK to pass via `-isysroot` to an underlying compiler from
Xcode or the CommandLineTools. Other toolchains like Homebrew's `gcc-*`
come with a default SDK too. Therefore, when targeting macOS, we no
longer need to choose any SDK or pass an `-isysroot` flag by default.
Update initialization of `CMAKE_OSX_SYSROOT` to be empty by default when
targeting macOS.
Fixes: #19180
We select the list of macOS architectures based on the version of Xcode.
Therefore we should use a macosx SDK that comes with Xcode to make sure
it has all the selected architectures. For example, on macOS 10.15 the
system `/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk` SDK
may have only `x86_64`, but Xcode 12 can be installed with SDKs that
support both `arm64` and `x86_64`.
Three of these tests were still using the compiler selected for building
CMake itself. In general our test suite is supposed to let each test
select the compiler from the environment. This is particularly
important on macOS where CMake might be built with compilers inside
Xcode, which require an explicit `CMAKE_OSX_SYSROOT`.
This boolean setting allows parallel building to be disabled for
individual source files built via `add_custom_command`. Using this
option is equivalent to setting policy `CMP0147` to the `OLD` behavior.
Closes: #26413
- Refactor and optimize the loop to make it shorter and faster
- Make it push elements into an arbitrary (templated) output iterator
- Make it a template on a separator type with the most used defaults
- Add a backward compatible signature to return `std::vector<std::string>`
- Add an alternative function `cmTokenizedView()` to return a vector of string views
Rerun CMake when `cmake_install.cmake` or `CTestTestfile.cmake` are out
of date. This enables regeneration if a subdirectory is removed before
invoking `ninja`.
Fixes: #26396
61aee8c7bd Add support of "LINKER:" prefix for Windows executable creation
8bcf9c7a3e Add support of "LINKER:" prefix for artifact creation flags
2bd4c06c26 Refactoring cmRulePlaceHolderExpander: propagate cmBuildStep information
35350c419d Add support of "LINKER:" prefix for CMAKE_<TYPE>_LINKER_FLAGS variable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9922
The `Signal` case occasionally reaches the `TIMEOUT_SIGNAL_GRACE_PERIOD`
before the test process has a chance to print its `SIGUSR1` count.
Extend the grace period to make it less likely to be exceeded.
The following variables now support the LINKER: prefix:
* CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS
* CMAKE_SHARED_MODULE_CREATE_<LANG>_FLAGS
* CMAKE_<LANG>_LINK_FLAGS
Create a `cm::PathResolver` helper to compute normalized paths.
Provide a common implementation with compile-time dispatch to
select details w.r.t. symbolic links, existence, and matching
the on-disk case of existing paths. Later we can use this to
implement:
* `ToNormalizedPathOnDisk`: Normalizes paths while resolving symlinks
only when followed by `..` components. Does not require paths to
exist, but reads on-disk case of paths that do exist (on Windows).
* `GetRealPath`: Normalizes paths while resolving all symlinks.
Requires paths to exist, and reads their on-disk case (on Windows).
* `CollapseFullPath`: Normalizes paths in memory without disk access.
Assumes components followed by `..` components are not symlinks.
Abstract filesystem access through runtime dispatch so that we can test
Windows symbolic link and network path behavior without relying on real
environments. The overhead of runtime dispatch should be insignificant
during real filesystem access.
Issue: #16228
Issue: #17206
Add support for the "format" property of the Debug Adapter Protocol
StackTrace request to fulfill the host's request to format the resulting
StackFrame name differently.
When a single-value keyword is repeated, and the first instance is
missing a value, it prevents the value from the second instance from
being stored in a variable. This was a regression introduced by
commit ceeea4e511 (cmake_parse_arguments: Set variable if empty string
given after keyword, 2024-08-18). That change also didn't create a
variable if the keyword was given but without a value. The purpose
of the change was to always define a variable if a keyword was given.
Lastly, that change didn't protect the CMP0174 logic to make it only
apply to the PARSE_ARGV form.
The first two of the above problems are fixed here by tracking the
keywords given instead of checking which keywords were missing
values. The third problem is also fixed here, being tightly coupled
to the same logic as the first two problems.
Fixes: #26397
Since commit 7abd3137b7 (Linking: Optionally reorder direct dependencies
from LINK_LIBRARIES, 2024-09-19, v3.31.0-rc1~53^2) the strategy name
`PRESERVE_ORDER` has led users to expect that it strictly preserves
order. While the part of the link line generation logic controlled by
`LINK_LIBRARIES_STRATEGY` does preserve order, it is not the last step.
Toolchain-specific de-duplication can cause the order to change on the
actual link line generated in the build system.
Rename the strategies:
* `PRESERVE_ORDER` => `REORDER_MINIMALLY`
* `REORDER` => `REORDER_FREELY`
The new names make it clear that reordering is always possible, just to
varying degrees. Update the `LINK_LIBRARIES_STRATEGY` documentation to
clarify that the strategies do not directly control the final link line.
Fixes: #26400
Issue: #26271
The `PropertyOverridesVar` case occasionally reaches the `TIMEOUT`
property's timeout, which is not what the test expects. Extend the
property's timeout to make it less likely to be reached.
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