CMake/Tests/RunCMake
2024-08-16 11:10:27 +10:00
..
ABI
add_compile_definitions Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
add_custom_command Merge topic 'custom-command-output-hash-character' 2024-05-16 11:24:56 -04:00
add_custom_target add_custom_command: Allow OUTPUT filenames containing a hash '#' character 2024-05-15 13:27:46 -04:00
add_dependencies Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
add_executable
add_library add_library: Reject shared libraries on platforms that do not support them 2024-03-29 11:06:32 -04:00
add_link_options
add_subdirectory Ninja Multi-Config: Fix crash if config list is changed in subdirectory 2024-06-21 12:21:36 -04:00
add_test Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR 2024-01-29 10:30:24 -05:00
alias_targets
Android
AndroidMK
AndroidTestUtilities
AppleSilicon macOS: Suppress default '-arch arm64' with CMAKE_<LANG>_COMPILER_TARGET 2023-03-15 10:50:26 -04:00
AppleTextStubs Apple Text Based Stubs: should be usage in subdirectories 2024-03-14 14:33:48 +01:00
AutoExportDll Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
Autogen_1 GeneratorTarget: Fix missing system include cache key 2024-07-23 16:58:43 +02:00
Autogen_2 Autogen: Separate RunCMake.AutogenQtX tests 2024-06-24 15:00:51 +02:00
Autogen_3 Autogen: Separate RunCMake.AutogenQtX tests 2024-06-24 15:00:51 +02:00
Autogen_4 Autogen: Separate RunCMake.AutogenQtX tests 2024-06-24 15:00:51 +02:00
Autogen_5 Autogen: Revert "Add timestamp file for CMAKE_GLOBAL_AUTORCC_TARGET" 2024-07-10 15:22:02 +02:00
Autogen_6 Autogen: Fix compilation of unchanged source files 2024-07-17 18:12:04 +02:00
Autogen_common Autogen: Fix autogen test separation bugs 2024-07-17 18:12:04 +02:00
block
build_command
BuildDepends LFortran: Add support for this compiler 2024-07-22 16:50:33 -04:00
BuiltinTargets Optionally make test target depend on all 2023-11-10 13:19:11 -05:00
BundleUtilities
Byproducts
CacheNewline
CheckCompilerFlag Merge branch 'backport-3.28-ci-xcode-15.3' 2024-03-12 09:49:17 -04:00
CheckIPOSupported Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
CheckLinkerFlag
CheckModules codespell: Fix typos 2023-05-22 16:51:15 -04:00
CheckSourceCompiles Tests: With lfortran < 1.24 skip cases broken by incorrect filename handling 2024-01-08 15:25:57 -05:00
CheckSourceRuns Tests: With lfortran < 1.24 skip cases broken by incorrect filename handling 2024-01-08 15:25:57 -05:00
ClangTidy Add generator expression support to static code analysis hooks 2023-03-27 11:48:41 -04:00
cmake_host_system_information Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
cmake_language Experimental: add an experimental feature gate for import std 2024-04-12 11:46:39 -04:00
cmake_minimum_required
CMAKE_MSVCIDE_RUN_PATH
cmake_parse_arguments
cmake_path
cmake_pkg_config PkgC: Add cmake_pkg_config(EXTRACT) command 2024-07-29 13:14:46 -04:00
CMakeDependentOption Add deprecation warnings for policies CMP0128 and below 2024-02-06 17:07:09 -05:00
CMakePackage find_package: Save/restore PACKAGE_PREFIX_DIR 2024-04-19 11:44:09 -04:00
CMakePresets presets: Add graphviz support 2024-07-30 10:27:03 -04:00
CMakePresetsBuild presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
CMakePresetsPackage presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
CMakePresetsTest presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
CMakePresetsWorkflow presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
CMakeRelease
CMakeRoleGlobalProperty
CMP0004
CMP0019
CMP0022
CMP0026
CMP0027
CMP0037 CMP0037: Restore diagnostic message for invalid ALIAS target names 2024-05-14 10:44:47 -04:00
CMP0038
CMP0039
CMP0040
CMP0041
CMP0042
CMP0043
CMP0045
CMP0046
CMP0049
CMP0050
CMP0051
CMP0053
CMP0054
CMP0055
CMP0057
CMP0059
CMP0060 OrangeC: Add support for OrangeC compiler 2023-09-25 12:27:29 -04:00
CMP0064
CMP0065
CMP0068
CMP0069 Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
CMP0081
CMP0102
CMP0104
CMP0106
CMP0111 cmTarget: Add a way to represent imported shared library stubs 2023-07-18 13:21:01 -04:00
CMP0115 Add deprecation warnings for policies CMP0120 and below 2023-06-07 14:31:50 -04:00
CMP0116 Add deprecation warnings for policies CMP0120 and below 2023-06-07 14:31:50 -04:00
CMP0118 CMP0118: Revise documentation to describe actual behavior 2024-03-21 11:37:46 -04:00
CMP0119 OrangeC: Add support for OrangeC compiler 2023-09-25 12:27:29 -04:00
CMP0121 GenEx LIST: list operations 2023-04-16 12:00:20 +02:00
CMP0125
CMP0126 Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
CMP0129 Add deprecation warnings for policies CMP0129 and below 2024-06-05 13:19:07 -04:00
CMP0132
CMP0135 ExternalProject: Move more internal commands out of main file 2024-05-13 20:24:47 +10:00
CMP0139
CMP0150 ExternalProject/FetchContent: Support relative remote URLs 2023-04-26 16:30:36 +08:00
CMP0152 file(REAL_PATH): resolve symlinks before '..' components 2023-07-20 17:02:58 -04:00
CMP0153 CMP0153: Add suggestion to use execute_process() 2023-10-27 09:43:18 -04:00
CMP0156 Tests: Update expected results for Xcode 16 2024-06-13 09:16:34 -04:00
CMP0160 cmTarget: Don't allow setting read-only properties 2024-01-23 08:50:38 -05:00
CMP0163 CMP0163: Make GENERATED source file property globally visible 2024-03-29 08:54:11 -04:00
CMP0165 enable_language(): Fail if called before project() 2024-04-02 23:00:38 +11:00
CMP0169 FetchContent: Deprecate FetchContent_Populate(depName) 2024-05-29 18:52:24 +10:00
CMP0170 FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements 2024-05-29 20:39:17 +10:00
CMP0171 add_custom_command: Add CODEGEN support 2024-07-01 12:02:49 -04:00
CMP0173 CMakeFindFrameworks: Deprecate the module subject to policy CMP0173 2024-08-16 11:10:27 +10:00
Codegen add_custom_command: Add CODEGEN support 2024-07-01 12:02:49 -04:00
Color Makefiles: quote $(COLOR) expansions 2023-06-08 11:05:11 -04:00
CommandLine Merge topic 'cmake-list-cached-variables' 2024-07-24 10:00:30 -04:00
CommandLineTar
CompatibleInterface
CompileDefinitions Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
CompileFeatures Tests/RunCMake/CompileFeatures: Avoid intermittent failures on AIX 2024-05-20 20:11:19 -04:00
CompilerArgs
CompilerChange Fix regression on reconfigure with unnormalized -DCMAKE_<LANG>_COMPILER= 2024-04-10 12:03:17 -04:00
CompilerLauncher
CompilerNotFound cmGlobalGenerator: hint about missing extensions on Windows 2023-10-24 11:21:31 -04:00
CompilerTest
CompileWarningAsError Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
Configure Tests/RunCMake/Configure: Improve variable scoping 2024-04-15 14:38:19 -04:00
configure_file
continue
CPack CPack/DEB: Add Multi-Arch support 2024-06-24 09:33:37 +02:00
CPack_NuGet CPack/NuGet: Build dependencies in groups 2024-06-03 11:28:49 -04:00
CPack_WIX Remove unnecessary executable permission from .ps1 scripts 2024-04-30 09:33:44 -04:00
CPackCommandLine
CPackConfig CPack/WIX: Generate perMachine installers by default 2024-07-18 14:16:54 -04:00
CPackInstallProperties
CPackSymlinks
Cppcheck Add generator expression support to static code analysis hooks 2023-03-27 11:48:41 -04:00
Cpplint Add generator expression support to static code analysis hooks 2023-03-27 11:48:41 -04:00
CrosscompilingEmulator Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR 2024-01-29 10:30:24 -05:00
CSharpCustomCommand
CSharpReferenceImport
CTest Dart,FindDart: Add policy to remove these modules 2023-02-28 08:43:45 -05:00
ctest_build Tests: Migrate CTestTest{NoBuild,NoExe} to RunCMake.ctest_{build,test} 2023-09-07 11:46:53 -04:00
ctest_cmake_error Tests: Update cmake_minimum_required version in RunCMake ctest cases 2024-03-29 14:17:58 -04:00
ctest_configure
ctest_coverage
ctest_disabled_test
ctest_empty_binary_directory ctest_empty_binary_directory: Report more detail in failure message 2023-11-09 09:11:55 -05:00
ctest_environment
ctest_fixtures CTest: Throw error if resource spec is invalid 2024-02-08 09:02:33 -05:00
ctest_labels_for_subprojects Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
ctest_memcheck codespell: Fix typos 2023-11-17 09:58:21 -05:00
ctest_skipped_test
ctest_start
ctest_submit ctest: Fall back to CMake environment variable for TLS server verification 2024-03-30 09:22:05 -04:00
ctest_test ctest: Restore enforcement of RESOURCE_LOCK test property 2024-04-01 12:22:29 -04:00
ctest_update
ctest_upload ctest: include "Time" element in Upload.xml 2024-02-27 13:51:11 -05:00
CTestCommandExpandLists
CTestCommandLine Tests: Move ctest --print-labels case into RunCMake.CTestCommandLine 2024-07-24 10:07:35 -04:00
CTestResourceAllocation CTest: Throw error if resource spec is invalid 2024-02-08 09:02:33 -05:00
CTestTimeout Tests: Do not expect EINTR when sleep is interrupted on GNU/Hurd 2023-12-08 09:07:24 -05:00
CTestTimeoutAfterMatch
CUDA_architectures CUDA: Factor out helper to validate CMAKE_CUDA_ARCHITECTURES 2023-09-21 15:34:28 -04:00
CXXModules importstd: clarify when the experimental UUID must be available 2024-05-15 07:15:05 -04:00
define_property Tests: Add unit tests for property redefinition 2024-01-29 05:23:37 -05:00
DependencyGraph Tests/RunCMake: Pass Fortran compiler id into more tests 2024-07-22 15:55:42 -04:00
DependencyProviders FetchContent: Fix FIND_PACKAGE_ARGS not being passed to dep providers 2023-12-16 16:42:00 +11:00
DisallowedCommands
ExcludeFromAll Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
execute_process Merge topic 'execute_process-child-startup-info' 2024-05-28 08:56:42 -04:00
export EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate 2024-03-12 14:24:53 -04:00
ExportCompileCommands
ExportImport
ExportWithoutLanguage
ExternalData
ExternalProject Tests: Fix RunCMake.ExternalProject when git is not available 2024-07-03 10:44:15 -04:00
ExtraGenerators
FeatureSummary
FetchContent FetchContent: Force cmake --fresh to re-execute direct population steps 2024-06-07 18:12:12 +10:00
FetchContent_find_package FetchContent: Deprecate FetchContent_Populate(depName) 2024-05-29 18:52:24 +10:00
file file(MAKE_DIRECTORY): Add optional RESULT keyword to capture failure. 2024-06-24 02:20:43 +02:00
File_Archive
File_Configure
File_Generate Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
file-CHMOD
file-DOWNLOAD Tests/RunCMake/file-DOWNLOAD: Update bad host name message for curl 8.9 2024-07-29 11:07:05 -04:00
file-GET_RUNTIME_DEPENDENCIES file(GET_RUNTIME_DEPENDENCIES): propagate parent rpath on macOS 2024-04-15 11:59:39 -04:00
file-MAKE_DIRECTORY file(MAKE_DIRECTORY): Add optional RESULT keyword to capture failure. 2024-06-24 02:20:43 +02:00
file-RPATH file(RPATH_CHANGE ...): no-op for static binary 2024-06-24 11:32:30 -04:00
file-STRINGS file: STRINGS + REGEX store match results 2024-01-09 16:36:55 -05:00
FileAPI fileapi: Add CONFIGURE_DEPENDS glob info to cmakeFiles object 2024-03-19 14:55:25 -04:00
FileAPIExternalSource
find_dependency
find_file Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
find_library MSVC: Teach find_library to consider the 'libfoo.a' naming convention 2024-01-19 17:12:36 -05:00
find_package find_package(): Debug re-rooting behavior 2024-08-02 16:18:44 -04:00
find_path Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
find_program Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
FindBoost FindBoost: Add policy to remove this module 2024-05-03 10:30:23 -04:00
FindGTK2
FindLua
FindMatlab
FindOpenGL FindOpenGL: Add support for a separate GLU include directory 2024-02-05 14:06:06 -05:00
FindOpenSSL
FindPkgConfig FindPkgConfig: Fix parsing of quoted lists with pkgconf <1.5.1 2024-04-20 21:03:56 +03:00
FindSWIG
foreach Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
FPHSA FPHSA: Add hint for failure when called before project() 2024-05-01 11:25:28 -04:00
Framework Apple: Add CFBundleName to framework Info.plist files 2024-06-20 10:33:07 -04:00
function
GenerateExportHeader GenerateExportHeader: Suppress clang-tidy warning 2024-04-10 16:43:48 -04:00
GeneratorExpression GenEx: Add generator expr. for CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT 2024-05-22 16:43:33 +02:00
GeneratorExpressionShortCircuit cmGeneratorExpressionNode: Fix short-circuit logic 2023-11-13 11:11:18 -05:00
GeneratorInstance
GeneratorPlatform Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
GeneratorToolset VS: Add support for using Intel oneAPI Fortran compiler in .vfproj files 2023-11-22 10:22:12 -05:00
GenEx-COMPILE_LANG_AND_ID
GenEx-COMPILE_LANGUAGE
GenEx-DEVICE_LINK
GenEx-GENEX_EVAL
GenEx-HOST_LINK
GenEx-LINK_GROUP
GenEx-LINK_LANG_AND_ID
GenEx-LINK_LANGUAGE
GenEx-LINK_LIBRARY Link feature attributes: stabilization 2024-06-21 11:18:20 +02:00
GenEx-LIST list(INSERT): restore old behavior 2023-08-17 12:07:41 +02:00
GenEx-PATH
GenEx-PATH_EQUAL
GenEx-TARGET_FILE
GenEx-TARGET_IMPORT_FILE Apple: Handle generation and comsuption of text-based stubs (.tbd files) 2023-03-01 12:23:28 +01:00
GenEx-TARGET_PROPERTY Help: Document TARGET_PROPERTY genex behavior on unset property 2024-05-10 09:50:33 -04:00
GenEx-TARGET_RUNTIME_DLLS Add test for the new TARGET_RUNTIME_DLL_PATHS genex 2023-02-26 16:37:37 +01:00
get_filename_component
get_property get_test_property(): Add DIRECTORY option 2023-08-11 10:50:52 -04:00
GetPrerequisites
GNUInstallDirs
GoogleTest Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
Graphviz Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
IAR Tests/RunCMake/IAR: Extend tests to actually build 2024-02-12 14:42:54 -05:00
if Tests: Factor out RunCMake helper to get UNIX user id 2023-11-30 17:05:00 -05:00
IfacePaths
include FindBoost: Add policy to remove this module 2024-05-03 10:30:23 -04:00
include_directories
include_external_msproject Tests: Avoid running VS 16+ tests when using a pre-v140 toolset 2024-05-13 10:57:27 -04:00
include_guard
IncludeWhatYouUse IWYU: Return error code if user enables error reporting 2023-04-25 11:18:36 -04:00
IncompatibleQt
InitialFlags
install Evaluation of TRANSITIVE_LINK_PROPERTIES isn't considered a usage 2024-07-05 13:16:47 -04:00
INSTALL_NAME_DIR
InstallParallel install: Write manifest file in parallel install 2024-07-25 12:36:32 -04:00
InterfaceLibrary Tests/RunCMake: Match 'Tried extensions' output more robustly 2023-03-09 14:35:05 -05:00
Languages
LanguageStandards Add CMAKE_<LANG>_STANDARD_LATEST variables 2024-04-30 11:05:03 -04:00
LinkerLauncher
LinkerSelection Tests: Update expected results for Xcode 16 2024-06-13 09:16:34 -04:00
LinkItemValidation
LinkLibrariesProcessing Libraries processing: update configuration wording 2024-06-21 11:18:12 +02:00
LinkStatic
LinkWhatYouUse
list list(): restore SUBLIST behavior 2023-06-16 15:14:03 +02:00
load_cache
MacOSVersions codespell: Avoid escape sequence that looks like misspelled "nodes" 2023-05-22 16:50:51 -04:00
Make ctest: Allow passing -j without value to choose a contextual default 2024-03-10 11:41:39 -04:00
math
MaxRecursionDepth find_package: Enforce maximum nesting depth below maximum recursion depth 2023-03-13 11:48:19 -04:00
message codespell: Fix typos 2023-05-22 16:51:15 -04:00
MetaCompileFeatures
MSVCDebugInformationFormat
MSVCRuntimeLibrary
MSVCRuntimeTypeInfo Add deprecation warnings for policies CMP0120 and below 2023-06-07 14:31:50 -04:00
MSVCWarningFlags
MultiLint Linting: Fix empty evaluated genex 2023-09-25 09:16:33 -04:00
Ninja LFortran: Add support for this compiler 2024-07-22 16:50:33 -04:00
NinjaMultiConfig Autogen: Filter out QtDeployTargets from Ninja Multi-Config tests 2024-06-26 14:04:46 +02:00
NinjaPrivateDeps Tests/NinjaPrivateDeps: fix error message for Build-PrivateFileSet-check 2023-10-16 11:38:43 -04:00
no_install_prefix
ObjectLibrary Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
ObsoleteQtMacros
option
ParseImplicitData LFortran: Add support for mixed-language linking with Fortran 2024-08-02 15:15:02 -04:00
ParseImplicitIncludeInfo CMakeParseImplicitLinkInfo: Honor gfortran -static-libquadmath flag 2024-07-16 16:42:18 -04:00
ParseImplicitLinkInfo LFortran: Add support for mixed-language linking with Fortran 2024-08-02 15:15:02 -04:00
Policy
PolicyScope
PositionIndependentCode
PrecompileHeaders Merge topic 'restore-pch-with-unity' 2024-02-05 09:57:19 -05:00
PrintHelpers Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
project CMAKE_PROJECT_INCLUDE: Allow to run module files 2023-10-18 18:01:05 +02:00
project_injected
property_init cmTarget: support the CXX_MODULE_STD property 2024-04-11 10:19:44 -04:00
return
RunCPack CPack/NuGet: Build dependencies in groups 2024-06-03 11:28:49 -04:00
RuntimePath Link explicitly to private transitive dependencies on stub libraries 2024-01-04 11:59:26 -05:00
ScriptMode
separate_arguments Tests: Avoid unnecessary copy of cmake in RunCMake.separate_arguments 2024-04-15 10:13:28 -04:00
set set: Improve diagnostics for CACHE mode 2023-08-02 10:07:56 -04:00
set_property cmTarget: Don't allow setting read-only properties 2024-01-23 08:50:38 -05:00
set_tests_properties set_tests_properties(): Add DIRECTORY option 2023-08-11 10:50:52 -04:00
SourceProperties Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
string
Swift Merge topic 'swift-install-names' 2024-08-02 09:47:51 -04:00
SymlinkTrees Tests/RunCMake: Set $ENV{PWD} before each test 2023-09-11 16:58:14 -04:00
Syntax
target_compile_definitions Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_compile_features Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_compile_options Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_include_directories
target_link_directories
target_link_libraries Merge topic 'Xcode-Check-Imported-Framework' 2023-12-19 08:04:01 -05:00
target_link_libraries-ALIAS Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_link_libraries-LINK_GROUP Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_link_libraries-LINK_LANG_AND_ID Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_link_libraries-LINK_LANGUAGE Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
target_link_libraries-LINK_LIBRARY GenEx $<LINK_LIBRARY>: Add the support of properties attached to features 2024-05-15 10:02:36 +02:00
target_link_options LINK_OPTIONS: ensure correct dollar escaping 2023-07-17 15:55:58 +02:00
target_sources cmTarget: Don't allow setting read-only properties 2024-01-23 08:50:38 -05:00
TargetArtifacts Add option to add SOVERSION to DLL names 2023-02-27 09:18:34 -05:00
TargetObjects Restore support for TARGET_OBJECTS in link interfaces with unity builds 2024-02-21 17:08:57 -05:00
TargetPolicies VS: Add UseDebugLibraries to vcxproj files by default 2024-02-22 08:43:16 -05:00
TargetProperties
test_include_dirs
TIClang TIClang: Add support for TI Clang-based compilers, including tiarmclang 2024-02-09 15:54:40 -05:00
ToolchainFile Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
TransformDepfile cmTransformDepfile: warn when a depfile is not written to 2023-11-01 14:08:18 -04:00
try_compile try_compile: Propagating top level includes into whole-project calls 2024-05-30 19:01:03 +10:00
try_run Tests: Fix RunCMake.try_run case on gfortran < 4.3 2023-12-07 10:49:25 -05:00
UnityBuild Add support for unity builds with CUDA sources 2024-08-02 13:35:53 -04:00
UseSWIG Add deprecation warnings for policies CMP0126 and below 2023-10-03 17:21:47 -04:00
variable_watch
VerifyHeaderSets VERIFY_INTERFACE_HEADER_SETS: Suppress clang-tidy include checks 2024-04-08 19:15:21 -04:00
VisibilityPreset
VS10Project VS: Add VS_FRAMEWORK_REFERENCES 2024-06-26 16:44:51 +01:00
VS10ProjectUseDebugLibraries VS: Add UseDebugLibraries to vcxproj files by default 2024-02-22 08:43:16 -05:00
VS10ProjectWinCE
VsDotnetSdk VS: Support add_custom_command in .Net SDK-style projects 2024-06-25 13:31:44 +01:00
VsNugetPackageRestore
VSSolution Drop Visual Studio 9 2008 generator 2024-05-08 10:37:34 -04:00
while
Win32GenEx
WorkingDirectory
WriteBasicConfigVersionFile
WriteCompilerDetectionHeader Add deprecation warnings for policies CMP0120 and below 2023-06-07 14:31:50 -04:00
XcFramework iOS: Add support for Mac Catalyst 2024-07-03 11:15:45 -04:00
XcodeProject Xcode: Restore support for CMAKE_OSX_ARCHITECTURES=$(ARCHS_STANDARD) 2024-07-19 09:42:45 -04:00
XcodeProject-Device Merge branch 'backport-3.28-visionOS' into visionOS 2024-02-09 11:37:11 -05:00
XcodeProject-Embed Xcode: Add support to embed XPC Services 2023-11-30 10:09:34 +13:00
AddRunCMakeTest.cmake Tests/RunCMake: Add script to auto-generate RunCMake test suite stub 2023-03-07 14:30:29 -05:00
CMakeLists.txt CMakeFindFrameworks: Deprecate the module subject to policy CMP0173 2024-08-16 11:10:27 +10:00
color_warning.c
detect_jobserver.c Reduce scope of variable 2024-02-14 20:46:03 +01:00
exit_code.c
exit_crash.c Tests: Cover execute_process with abnormal exit on all platforms 2024-05-14 09:32:53 -04:00
fake_build_command.c
FileAPIDummyFile.cmake
print_stdin.c Fix clang -Wstrict-prototypes by making main take void instead of nothing 2023-10-20 12:20:13 -04:00
pseudo_cppcheck.c
pseudo_cpplint.c
pseudo_emulator_custom_command_arg.c
pseudo_emulator_custom_command.c
pseudo_emulator.c Tests: Teach pseudo_emulator helper to pass by default 2024-01-27 09:50:43 -05:00
pseudo_iwyu.c
pseudo_llvm-rc.c
pseudo_tidy.c
README.rst Help/dev: Add a CMake Testing Guide 2024-06-05 12:58:47 -04:00
RunCMake.cmake Tests/RunCMake: Add option to print custom details in failure output 2024-03-18 14:04:17 -04:00
RunCPack.cmake Tests/RunCMake: Add new infrastructure to run cpack 2024-03-18 14:04:17 -04:00
RunCTest.cmake Tests/RunCMake: Add copyright and license notices to test infrastructure 2024-02-05 12:39:56 -05:00
showIncludes.c Merge topic 'clang-cl-showIncludes' 2024-02-08 09:40:54 -05:00
testStartupInfo.c Tests/RunCMake/execute_process: Check STARTUPINFOW reserved members 2024-05-24 10:12:27 -04:00

CMake Tests/RunCMake Directory
******************************

This directory contains tests that run CMake and/or other tools while
precisely checking their return code and stdout/stderr content.
The RunCMake infrastructure is useful for testing error cases and
diagnostic output.

See also `../README.rst`_, the `CMake Testing Guide`_,
and the `CMake Source Code Guide`_.

.. _`../README.rst`: ../README.rst
.. _`CMake Testing Guide`: ../../Help/dev/testing.rst
.. _`CMake Source Code Guide`: ../../Help/dev/source.rst
.. _`CMakeLists.txt`: CMakeLists.txt

Adding a Test
=============

To add a test:

1. Add a subdirectory named for the test, say ``<Test>/``.

2. In `CMakeLists.txt`_ call ``add_RunCMake_test`` and pass the
   test directory name ``<Test>``.

3. Create script ``<Test>/RunCMakeTest.cmake`` in the directory containing::

    include(RunCMake)
    run_cmake(Case1)
    ...
    run_cmake(CaseN)

   where ``Case1`` through ``CaseN`` are case names each corresponding to
   an independent CMake run and project configuration.

   One may also add calls of the form::

    run_cmake_command(CaseI ${CMAKE_COMMAND} ...)

   to fully customize the test case command-line.

   Alternatively, if the test is to cover running ``ctest -S`` then use::

    include(RunCTest)
    run_ctest(Case1)
    ...
    run_ctest(CaseN)

   and create ``test.cmake.in``, ``CTestConfig.cmake.in``, and
   ``CMakeLists.txt.in`` files to be configured for each case.

   Alternatively, if the test is to cover running ``cpack -G`` then use::

    include(RunCPack)
    run_cpack(Sample1)
    ...
    run_cpack(SampleN)

   where ``Sample1`` through ``SampleN`` are sample project directories
   in the ``RunCPack/`` directory adjacent to this file.

4. Create file ``<Test>/CMakeLists.txt`` in the directory containing::

    cmake_minimum_required(...)
    project(${RunCMake_TEST} NONE) # or languages needed
    include(${RunCMake_TEST}.cmake)

   where ``${RunCMake_TEST}`` is literal.  A value for ``RunCMake_TEST``
   will be passed to CMake by the ``run_cmake`` macro when running each
   case.

5. Create a ``<Test>/<case>.cmake`` file for each case named
   above containing the actual test code.  Optionally create files
   containing expected test results:

   ``<case>-result.txt``
    Regex matching expected process result, if not ``0``
   ``<case>-stdout.txt``
    Regex matching expected stdout content
   ``<case>-stderr.txt``
    Regex matching expected stderr content, if not ``^$``
   ``<case>-check.cmake``
    Custom result check.

   To specify platform-specific matches, create files of the form
   ``<case>-{stdout,stderr}-<platform_lower_case>.txt``.

   Note that trailing newlines will be stripped from actual and expected
   test output before matching against the stdout and stderr expressions.
   The code in ``<case>-check.cmake`` may use the `RunCMake Variables`_.
   On failure the script must store a message in ``RunCMake_TEST_FAILED``.
   The check script may optionally set ``RunCMake_TEST_FAILURE_MESSAGE``
   with additional text to be included in the message if the test fails.

RunCMake Commands
=================

A ``RunCMakeTest.cmake`` script, after ``include(RunCMake)``, may use
the following commands.

``run_cmake(<case>)``
  Run CMake or another command and check expected results described by
  ``<case>-{result,stdout,stderr}.txt`` and ``<case>-check.cmake``.
  The command is executed by a call of the form::

    execute_process(
      COMMAND ${RunCMake_TEST_COMMAND} ${RunCMake_TEST_OPTIONS}
      WORKING_DIRECTORY "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}"
      [TIMEOUT "${RunCMake_TEST_TIMEOUT}"]
      ...
      )

  Behavior may be customized by setting `RunCMake Variables`_ before
  the call.

``run_cmake_command(<case> <command> <args>...)``
  Sets ``RunCMake_TEST_COMMAND`` to ``<command>;<args>...``
  and calls ``run_cmake(<case>)``.

  This is useful to run an arbitrary command.

``run_cmake_script(<case> <args>...)``
  Sets ``RunCMake_TEST_COMMAND`` to
  ``${CMAKE_COMMAND};<args>...;-P;${RunCMake_SOURCE_DIR}/<case>.cmake``
  and calls ``run_cmake(<case>)``.

  This is useful to run CMake in script mode without configuring a project.

``run_cmake_with_options(<case> <opts>...)``
  Sets ``RunCMake_TEST_OPTIONS`` to ``<opts>...``
  and calls ``run_cmake(<case>)``.

``run_cmake_with_raw_args(<case> "<args>")``
  Calls ``run_cmake(<case>)`` with the underlying ``execute_process()``
  call extended with the content of ``<args>`` treated as literal source
  code of CMake language command arguments::

    execute_process(
      COMMAND ${RunCMake_TEST_COMMAND} ${RunCMake_TEST_OPTIONS} <args>
      ...
      )

  This is useful to pass arguments to the test command that cannot be
  encoded in CMake language ``;``-separated lists.

RunCMake Variables
==================

The behavior of `RunCMake Commands`_ such as ``run_cmake()`` may be
customized by setting the following variables before a call.

``RunCMake_GENERATOR``
  CMake generator to use when configuring projects.
  This provided to ``RunCMakeTest.cmake`` scripts automatically
  when they are executed, based on the CMake generator used to
  configure the test suite.

  For some generators, additional variables are also provided:

  ``RunCMake_GENERATOR_PLATFORM``
    Specifies the ``CMAKE_GENERATOR_PLATFORM``.

  ``RunCMake_GENERATOR_TOOLSET``
    Specifies the ``CMAKE_GENERATOR_TOOLSET``.

  ``RunCMake_GENERATOR_INSTANCE``
    Specifies the ``CMAKE_GENERATOR_INSTANCE``.

``RunCMake_GENERATOR_IS_MULTI_CONFIG``
  Boolean value indicating whether ``${RunCMake_GENERATOR}`` is a
  multi-config generator.
  This provided to ``RunCMakeTest.cmake`` scripts automatically
  when they are executed, based on the CMake generator used to
  configure the test suite.

``RunCMake_SOURCE_DIR``
  Absolute path to the ``Tests/RunCMake/<Test>`` directory in
  the CMake source tree.  This provided to ``RunCMakeTest.cmake``
  scripts automatically when they are executed.

``RunCMake_BINARY_DIR``
  Absolute path to the ``Tests/RunCMake/<Test>`` directory in
  the CMake binary tree.  This provided to ``RunCMakeTest.cmake``
  scripts automatically when they are executed.

``RunCMake_TEST_SOURCE_DIR``
  Absolute path to the individual test case's source tree.
  If not set, defaults to ``${RunCMake_SOURCE_DIR}``.

``RunCMake_TEST_BINARY_DIR``
  Absolute path to the individual test case's binary tree.
  If not set, defaults to ``${RunCMake_BINARY_DIR}/<case>-build``.

``RunCMake_TEST_NO_CLEAN``
  Boolean value indicating whether ``run_cmake(<case>)`` should remove the
  ``${RunCMake_TEST_BINARY_DIR}`` directory before running the test case.
  If not set, or if set to a false value, the directory is removed.

  This is useful to run `Multi-Step Test Cases`_.

``RunCMake_TEST_COMMAND``
  The command for ``run_cmake(<case>)`` to execute.
  If not set, defaults to running CMake to generate a project::

    ${CMAKE_COMMAND} ${RunCMake_TEST_SOURCE_DIR} \
      -G ${RunCMake_GENERATOR} ... -DRunCMake_TEST=<case>

``RunCMake_TEST_COMMAND_WORKING_DIRECTORY``
  The working directory in which ``run_cmake(<case>)`` to execute its command.
  If not set, defaults to ``${RunCMake_TEST_BINARY_DIR}``.

``RunCMake_TEST_OPTIONS``
  Additional command-line options for ``run_cmake(<case>)`` to pass to
  CMake when configuring a project with a default ``RunCMake_TEST_COMMAND``.
  If not set, defaults to empty.
  If ``RunCMake_TEST_COMMAND`` is set, ``RunCMake_TEST_OPTIONS`` is forced
  to empty.

``RunCMake_TEST_OUTPUT_MERGE``
  Boolean value indicating whether ``run_cmake(<case>)`` should redirect
  the test process's ``stderr`` into its ``stdout``.

``RunCMake_TEST_TIMEOUT``
  Specify a timeout, in seconds, for ``run_cmake(<case>)`` to pass to its
  underlying ``execute_process()`` call using the ``TIMEOUT`` option.

Multi-Step Test Cases
=====================

Normally each ``run_cmake(<case>)`` call corresponds to one standalone
test case with its own build tree.  However, some test cases may require
multiple steps to be performed in a single build tree.  This can be
achieved as follows::

  block()
    set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/example-build)
    run_cmake(example)
    set(RunCMake_TEST_NO_CLEAN 1)
    set(RunCMake_TEST_OUTPUT_MERGE 1)
    run_cmake_command(example-build ${CMAKE_COMMAND} --build . --config Debug)
  endblock()

In this example, ``block() ... endblock()`` is used to isolate the
variable settings from later cases.  A single build tree is used for
all cases inside the block.  The first step cleans the build tree and
runs CMake to configure the case's project.  The second step runs
``cmake --build`` to drive the generated build system and merges the
build tool's ``stderr`` into its ``stdout``.  Note that each call uses
a unique case name so that expected results can be expressed individually.

Running a Test
==============

Each call to ``add_RunCMake_test(Example)`` in `CMakeLists.txt`_ creates
a test named ``RunCMake.Example`` that may be run with ``ctest``::

  $ ctest -R "^RunCMake\.Example$"

To speed up local testing, you can choose to run only a subset of
``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the
``RunCMake_TEST_FILTER`` environment variable. If this variable is set,
it is treated as a regular expression, and any tests whose names don't
match the regular expression are not run. For example::

  $ RunCMake_TEST_FILTER="^example" ctest -R '^RunCMake\.Example$'

This will only run cases in ``RunCMake.Example`` that start with
``example``.

To speed up the process of creating a new ``RunCMake`` test, you can run a
script that will automatically perform steps 1 through 4 for you::

  cmake -DRunCMake_TEST_SUITE=<test suite name> -P Tests/RunCMake/AddRunCMakeTestSuite.cmake

Be sure to run this from the top-level CMake source directory.