CMake/Tests/RunCMake
Brad King 48292c8624 try_compile: Record stack of in-progess checks in configure log
Many `try_compile` and `try_run` calls occur inside check modules
between `message(CHECK_START)` and `message(CHECK_{PASS,FAIL})` pairs.
Add a field to configure log entries to report this context.

Issue: #23200
2023-01-16 17:18:07 -05:00
..
ABI
add_compile_definitions COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases 2022-12-13 16:54:56 +01:00
add_custom_command add_custom_{command,target}: add genex support for COMMENT 2022-11-19 13:32:56 +01:00
add_custom_target add_custom_{command,target}: add genex support for COMMENT 2022-11-19 13:32:56 +01:00
add_dependencies
add_executable
add_library
add_link_options
add_subdirectory add_subdirectory: Add SYSTEM option 2022-09-26 10:56:54 -04:00
add_test
alias_targets Add deprecation warnings for policies CMP0108 and below 2022-10-12 12:40:52 -04:00
Android
AndroidMK cmInstallExportGenerator: expose the temporary directory 2022-04-28 09:13:48 -04:00
AndroidTestUtilities
AppleSilicon
ArtifactOutputDirs
AutoExportDll Tests: Fix ARM64 test conditions for non-VS generators 2022-11-09 10:22:46 -05:00
Autogen Tests: Add support for testing Qt6 2021-10-04 22:10:57 +11:00
block block: Fix variable scope protection from modification by subdirectories 2022-11-07 14:24:24 -05:00
build_command
BuildDepends Drop Visual Studio 10 2010 generator 2022-09-26 15:43:04 -04:00
BundleUtilities
Byproducts
CacheNewline
CheckCompilerFlag CheckCompilerFlag: Add Swift Support 2022-11-04 09:32:06 -07:00
CheckIPOSupported CUDA: Add Device LTO support for nvcc 2022-07-22 10:34:45 -04:00
CheckLinkerFlag Tests: Clarify RunCMake.Check* case names 2022-10-06 10:29:42 -04:00
CheckModules
CheckSourceCompiles CheckSourceCompiles: Add support for Swift 2022-10-24 12:39:21 -04:00
CheckSourceRuns Tests: Move TryCompile check module cases to RunCMake.Check* 2022-10-06 10:29:42 -04:00
ClangTidy clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property 2022-12-06 10:39:29 -05:00
cmake_host_system_information cmCMakeHost*Command: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
cmake_language Add new flow-control commands for variables and policies scopes management 2022-08-22 16:25:53 +02:00
cmake_minimum_required
CMAKE_MSVCIDE_RUN_PATH VS: Always enable CMAKE_MSVCIDE_RUN_PATH 2021-07-12 11:19:01 -04:00
cmake_parse_arguments
cmake_path cmCMakePathCommand: Enforce non-empty string arguments via binding type 2022-07-28 08:25:00 -04:00
CMakeDependentOption CMakeDependentOption: allow in depends the use of . 2022-09-21 13:19:45 -04:00
CMakePresets cmake: Add --workflow mode 2022-09-27 11:09:06 -04:00
CMakePresetsBuild presets: bump version to v5 2022-03-08 08:18:02 -05:00
CMakePresetsPackage Tests: Add test for cpack --list-presets 2022-09-23 09:40:14 -04:00
CMakePresetsTest Tests: Isolate more RunCMake cases from external ctest environment values 2022-11-14 11:08:45 -05:00
CMakePresetsWorkflow cmake --workflow: add --fresh option 2022-10-26 12:01:25 -04:00
CMakeRelease Utilities/Release: Add windows-arm64 package to file table 2022-06-13 15:27:34 -04:00
CMakeRoleGlobalProperty
CMP0004
CMP0019
CMP0022
CMP0026
CMP0027
CMP0037
CMP0038
CMP0039
CMP0040
CMP0041
CMP0042
CMP0043
CMP0045
CMP0046
CMP0049
CMP0050
CMP0051
CMP0053
CMP0054
CMP0055
CMP0057
CMP0059
CMP0060
CMP0064
CMP0065
CMP0068
CMP0069
CMP0081
CMP0102 Add deprecation warnings for policies CMP0102 and below 2022-06-14 15:05:03 -04:00
CMP0104 Add deprecation warnings for policies CMP0108 and below 2022-10-12 12:40:52 -04:00
CMP0106 Add deprecation warnings for policies CMP0108 and below 2022-10-12 12:40:52 -04:00
CMP0111
CMP0115
CMP0116
CMP0118
CMP0119 LCC: Add dedicated support for MCST LCC compiler 2021-10-15 05:05:19 +03:00
CMP0121
CMP0125 Tests: Make RunCMake.CMP0125 robust to external filesystem content 2022-03-07 11:40:30 -05:00
CMP0126 CMP0126: Add control for warnings 2021-06-29 13:36:28 +02:00
CMP0129 LCC: Add policy CMP0129 regarding interpreting LCC as GNU 2021-10-21 17:24:22 +03:00
CMP0132 CMP0132: Don't set compiler environment variables on first run 2022-03-29 09:42:59 -04:00
CMP0135 FetchContent: Respect the CMP0135 policy setting 2022-06-02 11:10:27 +10:00
CMP0139 if command: Add PATH_EQUAL operator 2022-06-03 19:31:36 +02:00
Color color: Add tests for CMAKE_COLOR_DIAGNOSTICS 2022-03-08 17:29:12 -05:00
CommandLine cmake: Add -E copy_directory_if_different 2023-01-12 08:39:41 -05:00
CommandLineTar cmake -E tar: Add --touch option 2022-03-23 14:41:34 +01:00
CompatibleInterface
CompileDefinitions COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases 2022-12-13 16:54:56 +01:00
CompileFeatures Tests/CompileFeatures: Fix CMP0128OldSameStandard with default OFF 2022-06-04 18:40:21 +03:00
CompilerArgs Preserve CMAKE_${lang}_COMPILER_ARG1 from existing CMakeCache.txt 2022-03-29 10:36:28 -04:00
CompilerChange
CompilerLauncher COMPILER_LAUNCHER: Add support for generator expressions 2022-08-30 17:26:25 -04:00
CompilerNotFound
CompilerTest Tests: Test more CMakeTest*Compiler.cmake fallbacks 2022-09-29 09:26:23 -04:00
CompileWarningAsError NVHPC: warnings as error flag is "-Werror" 2022-07-01 08:05:19 -04:00
Configure try_compile: Record output location instead of reverse computing it 2022-09-07 15:08:41 -04:00
configure_file
continue
CPack CPack: re-use paths of tools discovered by CMakeFindBinUtils 2022-09-06 09:49:54 -04:00
CPackCommandLine
CPackConfig CPack/DMG: Do not use CPACK_RESOURCE_FILE_LICENSE for SLA by default 2022-04-14 10:14:58 -04:00
CPackInstallProperties
CPackSymlinks
Cppcheck
Cpplint
CrosscompilingEmulator
CSharpCustomCommand
CSharpReferenceImport
CTest
ctest_build ctest: only report make-level errors when no others are found 2022-09-26 09:40:58 -04:00
ctest_cmake_error
ctest_configure
ctest_coverage
ctest_disabled_test
ctest_environment Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
ctest_fixtures Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
ctest_labels_for_subprojects
ctest_memcheck Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
ctest_skipped_test
ctest_start
ctest_submit
ctest_test Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
ctest_update
ctest_upload
CTestCommandExpandLists
CTestCommandLine Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
CTestResourceAllocation clang-tidy: address google-readability-casting lints 2022-05-24 09:09:43 -04:00
CTestTimeout RunCMake/CTestTimeout: Include sched.h for pid_t 2022-06-27 20:34:53 +03:00
CTestTimeoutAfterMatch
CUDA_architectures Modules: Use new keyword-dispatched try_compile signature 2022-09-14 07:52:16 -04:00
CXXModules cxxmodules: support new round of Clang patches 2022-12-15 18:43:47 -05:00
define_property define_property(): Change constraints of INITIALIZE_FROM_VARIABLE 2022-03-23 16:39:32 +11:00
DependencyGraph
DependencyProviders Dependency providers: Add find_package and FetchContent support 2022-05-25 08:46:18 +10:00
DisallowedCommands
ExcludeFromAll
execute_process cmExecuteProcessCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
export Add deprecation warnings for policies CMP0108 and below 2022-10-12 12:40:52 -04:00
ExportCompileCommands Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule 2021-05-28 15:41:38 -04:00
ExportImport Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex 2022-11-17 09:31:27 -05:00
ExportWithoutLanguage
ExternalData
ExternalProject ExternalProject: Fix install on BUILD_ALWAYS+BUILD_BYPRODUCTS with Ninja 2022-08-09 08:27:11 -04:00
FeatureSummary
FetchContent Merge topic 'add_subdirectory_system' 2022-09-27 10:28:49 -04:00
FetchContent_find_package FetchContent: Ignore EXACT for redirected find_package() calls 2022-09-11 18:36:31 +10:00
file file(MAKE_DIRECTORY): Provide a more descriptive error message 2022-12-08 07:54:55 -05:00
File_Archive file(ARCHIVE_CREATE): Allow higher compression level for Zstd 2022-11-16 09:15:01 -05:00
File_Configure cmFileCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
File_Generate cmFileCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
file-CHMOD cmFileCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
file-DOWNLOAD Tests: Honor CMake_TEST_NO_NETWORK in RunCMake.file-DOWNLOAD 2022-11-18 09:09:36 -05:00
file-GET_RUNTIME_DEPENDENCIES Tests: Enable RunCMake.file-GET_RUNTIME_DEPENDENCIES linux cases on XL 2022-12-02 09:09:38 -05:00
file-RPATH file(RPATH): Restore tolerance of unknown formats if new RPATH is empty 2021-12-01 12:58:11 -05:00
FileAPI FileAPI: Add "configureLog" object kind 2022-12-17 08:52:04 -05:00
FileAPIExternalSource
find_dependency find_dependency: Avoid repeating identical dependency searches 2022-11-18 10:31:19 -05:00
find_file find_(program,library,file,path): add validation function 2022-06-14 16:17:46 -04:00
find_library Merge topic 'CMAKE_FIND_USE_INSTALL_PREFIX-support-staging-prefix' 2022-08-31 09:39:52 -04:00
find_package cmFindPackageCommand: Add one more search path 2022-08-04 09:41:59 -04:00
find_path find_(program,library,file,path): add validation function 2022-06-14 16:17:46 -04:00
find_program find_(program,library,file,path): add validation function 2022-06-14 16:17:46 -04:00
FindBoost Tests: Teach RunCMake.FindBoost to avoid finding an external Boost 2022-12-07 08:21:39 -05:00
FindGTK2
FindLua
FindMatlab
FindOpenGL
FindOpenSSL
FindPkgConfig Tests: Disable parts of FindPkgConfig tests without wide supported 2022-10-30 09:37:13 +11:00
FindSWIG
foreach
FPHSA FPHSA: Fix regression when VERSION_VAR is missing 2022-09-15 11:00:02 -04:00
Framework Xcode: ensure framework with custom output directory can be consumed 2022-10-14 09:13:37 -04:00
function
GenerateExportHeader Tests: Remove incidental use of C++98 compiler modes 2022-04-26 12:01:06 -04:00
GeneratorExpression Tests: Move some cases to RunCMake.GenEx-TARGET_PROPERTY 2022-11-15 10:45:21 -05:00
GeneratorInstance VS: Add a variable to report the Visual Studio version build number 2022-12-07 17:49:04 -05:00
GeneratorPlatform VS: Add Visual Studio 17 2022 generator 2021-06-25 12:45:44 -04:00
GeneratorToolset VS: ARM64 as default toolset architecture for ARM64 host 2022-05-19 09:57:54 -04:00
GenEx-COMPILE_LANG_AND_ID Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-COMPILE_LANGUAGE Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-DEVICE_LINK Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-GENEX_EVAL
GenEx-HOST_LINK Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-LINK_GROUP Check link libraries properties: fix performances regression 2022-09-07 15:20:53 +02:00
GenEx-LINK_LANG_AND_ID Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-LINK_LANGUAGE Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
GenEx-LINK_LIBRARY Check link libraries properties: fix performances regression 2022-09-07 15:20:53 +02:00
GenEx-PATH Genex-PATH: path handling 2022-05-31 15:39:51 +02:00
GenEx-PATH_EQUAL Genex-PATH_EQUAL: path comparison 2022-06-01 15:28:54 +02:00
GenEx-TARGET_FILE Genex: Fix TARGET_BUNDLE_DIR_NAME incorrect extension 2022-07-01 08:18:10 -04:00
GenEx-TARGET_PROPERTY Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements 2022-11-17 07:57:21 -05:00
GenEx-TARGET_RUNTIME_DLLS Tests: Shorten RunCMake.GenEx-* case names 2021-06-25 11:29:46 -04:00
get_filename_component
get_property Add directory property to list imported targets 2021-06-10 15:52:12 -04:00
GetPrerequisites Tests: Improve RunCMake.GetPrerequisites sample executable selection 2022-11-02 13:45:05 -04:00
GNUInstallDirs GNUInstallDirs: Revert "Apply Debian multiarch LIBDIR to more prefixes" 2022-03-30 11:51:01 -04:00
GoogleTest Tests: Isolate more RunCMake cases from external ctest environment values 2022-11-14 11:08:45 -05:00
Graphviz
if Merge topic 'while-bug-compatibility' 2022-03-04 08:53:17 -05:00
IfacePaths
include
include_directories
include_external_msproject VS: Exclude ZERO_CHECK.proj from .sln for include_external_msproject 2022-07-20 08:51:38 -04:00
include_guard
IncludeWhatYouUse
IncompatibleQt
InitialFlags
install Tests: Loosen RunCMake.install directory symlink expected output 2022-10-10 09:55:43 -04:00
INSTALL_NAME_DIR
InterfaceLibrary VS: Fix assertion failure on INCLUDE_DIRECTORIES in INTERFACE libraries 2021-07-29 11:38:58 -04:00
Languages
LinkerLauncher Launchers: Support setting linker launchers 2021-05-28 12:28:43 -04:00
LinkItemValidation target_link_libraries: Optionally require only target names 2021-12-20 12:14:07 -05:00
LinkStatic
LinkWhatYouUse Ninja: Revert accidental LINK_WHAT_YOU_USE impl for static libraries 2021-08-03 11:21:26 -04:00
list Tests: add tests to check claims in the documentation 2021-12-21 10:55:50 -05:00
load_cache
MacOSVersions
Make
math
MaxRecursionDepth
message cmMessenger: Revert to non-color messages on Windows 2021-07-20 13:30:11 -04:00
MetaCompileFeatures
MSVCDebugInformationFormat MSVC: Add abstraction for debug information format 2022-09-14 09:12:47 -04:00
MSVCRuntimeLibrary Add deprecation warnings for policies CMP0094 and below 2021-10-08 12:17:04 -04:00
MSVCRuntimeTypeInfo
MSVCWarningFlags Add deprecation warnings for policies CMP0094 and below 2021-10-08 12:17:04 -04:00
MultiLint
Ninja Ninja: Match showIncludes dependencies using console output code page 2022-10-30 08:29:55 -04:00
NinjaMultiConfig EXPORT_COMPILE_COMMANDS: add output field 2022-10-28 13:54:43 -04:00
no_install_prefix Find: Support per call disabling of CMAKE_INSTALL_PREFIX 2022-04-15 09:33:55 -04:00
ObjectLibrary Xcode: Add tests for OBJECT library per target OSX_ARCHITECTURES 2022-04-12 09:11:47 -07:00
ObsoleteQtMacros
option
ParseImplicitData Restore implicit include directory extraction for adaptive relative paths 2023-01-12 12:05:42 -05:00
ParseImplicitIncludeInfo CMakeParseLibraryArchitecture: Fix parsing /lib/<arch> implicit object path 2021-12-06 16:47:29 -05:00
ParseImplicitLinkInfo Merge topic 'flang-implicit-link-info' 2022-10-12 09:17:49 -04:00
Policy
PolicyScope
PositionIndependentCode LCC: Add dedicated support for MCST LCC compiler 2021-10-15 05:05:19 +03:00
PrecompileHeaders CMP0141: Fix PCH REUSE_FROM when MSVC_DEBUG_INFORMATION_FORMAT is empty 2022-11-15 06:57:02 -05:00
PrintHelpers Tests: Add tests for CMakePrintHelpers 2022-06-06 12:27:11 -04:00
project project: Warn at top-level if cmake_minimum_required wasn't called 2022-11-11 22:49:36 +01:00
project_injected project: Warn at top-level if cmake_minimum_required wasn't called 2022-11-11 22:49:36 +01:00
return return(): Propagate variables to result scope 2022-09-03 23:10:01 +02:00
RuntimePath
ScriptMode
separate_arguments
set
set_property
SourceProperties
string string(TIMESTAMP): Add %z and %Z for adding time zone string 2022-10-27 11:13:46 -04:00
Swift Ninja: Avoid re-linking a Swift executable on every build 2022-11-17 13:05:22 -05:00
SymlinkTrees Tests: Teach RunCMake.SymlinkTrees to tolerate CCACHE_BASEDIR 2022-08-30 16:41:20 -04:00
Syntax CMake: Allow override of unexpected non-flow-control commands 2021-06-16 10:39:39 -04:00
target_compile_definitions COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases 2022-12-13 16:54:56 +01:00
target_compile_features compile_features: Ignore features that map to languages that aren't enabled 2021-06-25 13:39:50 -04:00
target_compile_options cmTargetPropCommandBase: Restore ArgumentFlags enum value bool logic 2022-11-27 20:17:32 +11:00
target_include_directories
target_link_directories
target_link_libraries Add deprecation warnings for policies CMP0108 and below 2022-10-12 12:40:52 -04:00
target_link_libraries-ALIAS
target_link_libraries-LINK_GROUP genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genex 2022-07-05 10:00:04 +02:00
target_link_libraries-LINK_LANG_AND_ID
target_link_libraries-LINK_LANGUAGE
target_link_libraries-LINK_LIBRARY Genex LINK_LIBRARY: Add support for framework with postfix 2022-09-21 16:14:36 +02:00
target_link_options CUDA: Support CMP0105 on Clang 2021-11-08 21:26:00 +02:00
target_sources cxxmodules: support new round of Clang patches 2022-12-15 18:43:47 -05:00
TargetObjects
TargetPolicies Xcode: Do not append per-config suffixes to library search paths 2022-09-15 10:27:23 -04:00
TargetProperties Help: Document formatting of DEPRECATION target property 2022-01-13 15:56:54 -05:00
test_include_dirs Tests: Isolate more RunCMake cases from external ctest environment values 2022-11-14 11:08:45 -05:00
ToolchainFile try_compile: Propagate CMP0126 to the generated test project 2021-07-20 09:47:02 -04:00
TransformDepfile Tests: Remove unused RunCMake.TransformDepfile files 2021-06-08 13:10:02 -04:00
try_compile try_compile: Record stack of in-progess checks in configure log 2023-01-16 17:18:07 -05:00
try_run try_compile: Record stack of in-progess checks in configure log 2023-01-16 17:18:07 -05:00
UnityBuild Unity Build: Fix per-config sources in multi-config generators 2021-11-11 07:16:11 -05:00
UseSWIG Add deprecation warnings for policies CMP0088 and below 2021-06-30 10:07:42 -04:00
variable_watch
VerifyHeaderSets VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file 2022-10-07 19:00:28 +01:00
VisibilityPreset
VS10Project VS: Add COMMON_LANGUAGE_RUNTIME support for "netcore" 2022-10-28 11:55:58 -04:00
VS10ProjectWinCE
VsDotnetSdk VS: Add Xaml and Resx files to .Net SDK style projects 2022-12-06 15:42:23 +01:00
VsNugetPackageRestore cmGlobalVisualStudio10Generator: Auto restore NuGet packages. 2022-01-22 06:35:41 -05:00
VSSolution USE_FOLDERS: Treat as on by default 2022-11-08 09:32:18 -05:00
while while: diagnose errors during condition evaluation 2022-03-04 13:55:12 -05:00
Win32GenEx
WorkingDirectory
WriteBasicConfigVersionFile WriteBasicConfigVersion supports version strings such as 21.07.04 2021-05-27 15:18:37 -04:00
WriteCompilerDetectionHeader
XcodeProject XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE 2022-11-22 16:44:45 +01:00
XcodeProject-Embed Xcode: Allow bundling extensionkit extensions 2022-11-18 13:58:03 -06:00
CMakeLists.txt COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases 2022-12-13 16:54:56 +01:00
color_warning.c
exit_code.c
fake_build_command.c
FileAPIDummyFile.cmake
print_stdin.c
pseudo_cppcheck.c
pseudo_cpplint.c
pseudo_emulator_custom_command_arg.c
pseudo_emulator_custom_command.c
pseudo_emulator.c
pseudo_iwyu.c
pseudo_llvm-rc.c Tests: Suppress MSVC CRT deprecation warnings in pseudo_llvm-rc 2022-02-02 14:46:25 -05:00
pseudo_tidy.c clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property 2022-12-06 10:39:29 -05:00
README.rst
RunCMake.cmake ConfigureLog: Add infrastructure for structured configure event logging 2022-12-16 10:11:37 -05:00
RunCTest.cmake Tests: Factor out RunCMake ctest environment isolation 2022-11-14 11:05:56 -05:00
showIncludes.c Ninja: Match showIncludes dependencies using console output code page 2022-10-30 08:29:55 -04:00

This directory contains tests that run CMake to configure a project
but do not actually build anything.  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(SubTest1)
    ...
    run_cmake(SubTestN)

   where ``SubTest1`` through ``SubTestN`` are sub-test names each
   corresponding to an independent CMake run and project configuration.

   One may also add calls of the form::

    run_cmake_command(SubTestI ${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(SubTest1)
    ...
    run_ctest(SubTestN)

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

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
   sub-test.

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

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

  Note that when a specific platform expects differing stdout or stderr that
  can be done by adding a platform specific output file. These follow the
  naming convention of:
   ``<SubTest>-stdout-<platform_lower_case>.txt``
   ``<SubTest>-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 ``<SubTest>-check.cmake`` may use variables

   ``RunCMake_TEST_SOURCE_DIR``
    Top of test source tree
   ``RunCMake_TEST_BINARY_DIR``
    Top of test binary tree

   and an failure must store a message in ``RunCMake_TEST_FAILED``.

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 subtests in ``RunCMake.Example`` that start with
``example``.