You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Timo Röhling 773f520dfe
New upstream version 3.30.4
4 months ago
..
ABI New upstream version 3.21.2 3 years ago
Android New upstream version 3.21.2 3 years ago
AndroidMK New upstream version 3.24.0 3 years ago
AndroidTestUtilities New upstream version 3.8.0 8 years ago
AppleSilicon New upstream version 3.27.0~rc4 2 years ago
AppleTextStubs New upstream version 3.29.2 10 months ago
AutoExportDll New upstream version 3.29.2 10 months ago
Autogen New upstream version 3.29.2 10 months ago
BuildDepends New upstream version 3.30.0 7 months ago
BuiltinTargets New upstream version 3.29.2 10 months ago
BundleUtilities New upstream version 3.27.0~rc4 2 years ago
Byproducts New upstream version 3.27.0~rc4 2 years ago
CMAKE_MSVCIDE_RUN_PATH New upstream version 3.22.0 3 years ago
CMP0004 New upstream version 3.27.0~rc4 2 years ago
CMP0019 New upstream version 3.27.0~rc4 2 years ago
CMP0022 New upstream version 3.27.0~rc4 2 years ago
CMP0026 New upstream version 3.27.0~rc4 2 years ago
CMP0027 New upstream version 3.21.2 3 years ago
CMP0037 New upstream version 3.29.4 8 months ago
CMP0038 New upstream version 3.27.0~rc4 2 years ago
CMP0039 New upstream version 3.27.0~rc4 2 years ago
CMP0040 New upstream version 3.27.0~rc4 2 years ago
CMP0041 New upstream version 3.27.0~rc4 2 years ago
CMP0042 New upstream version 3.27.0~rc4 2 years ago
CMP0043 New upstream version 3.27.0~rc4 2 years ago
CMP0045 New upstream version 3.27.0~rc4 2 years ago
CMP0046 New upstream version 3.27.0~rc4 2 years ago
CMP0049 New upstream version 3.27.0~rc4 2 years ago
CMP0050 New upstream version 3.27.0~rc4 2 years ago
CMP0051 New upstream version 3.27.0~rc4 2 years ago
CMP0053 New upstream version 3.27.0~rc4 2 years ago
CMP0054 New upstream version 3.27.0~rc4 2 years ago
CMP0055 New upstream version 3.27.0~rc4 2 years ago
CMP0057 New upstream version 3.27.0~rc4 2 years ago
CMP0059 Imported Upstream version 3.6.0 9 years ago
CMP0060 New upstream version 3.28.0 1 year ago
CMP0064 New upstream version 3.27.0~rc4 2 years ago
CMP0065 New upstream version 3.27.0~rc4 2 years ago
CMP0068 New upstream version 3.18.2 4 years ago
CMP0069 New upstream version 3.30.0 7 months ago
CMP0081 New upstream version 3.27.0~rc4 2 years ago
CMP0102 New upstream version 3.27.0~rc4 2 years ago
CMP0104 New upstream version 3.26.4 2 years ago
CMP0106 New upstream version 3.27.0~rc4 2 years ago
CMP0111 New upstream version 3.28.0 1 year ago
CMP0115 New upstream version 3.28.0 1 year ago
CMP0116 New upstream version 3.28.0 1 year ago
CMP0118 New upstream version 3.30.0 7 months ago
CMP0119 New upstream version 3.28.0 1 year ago
CMP0121 New upstream version 3.27.0~rc4 2 years ago
CMP0125 New upstream version 3.23.0 3 years ago
CMP0126 New upstream version 3.29.2 10 months ago
CMP0129 New upstream version 3.23.0 3 years ago
CMP0132 New upstream version 3.24.0 3 years ago
CMP0135 New upstream version 3.30.0 7 months ago
CMP0139 New upstream version 3.27.0~rc4 2 years ago
CMP0150 New upstream version 3.27.0~rc4 2 years ago
CMP0152 New upstream version 3.28.0 1 year ago
CMP0153 New upstream version 3.28.0 1 year ago
CMP0156 New upstream version 3.30.0 7 months ago
CMP0160 New upstream version 3.29.2 10 months ago
CMP0163 New upstream version 3.30.0 7 months ago
CMP0165 New upstream version 3.30.0 7 months ago
CMP0169 New upstream version 3.30.0 7 months ago
CMP0170 New upstream version 3.30.0 7 months ago
CMakeDependentOption New upstream version 3.30.0 7 months ago
CMakePackage New upstream version 3.30.0 7 months ago
CMakePresets New upstream version 3.30.0 7 months ago
CMakePresetsBuild New upstream version 3.27.0~rc4 2 years ago
CMakePresetsPackage New upstream version 3.27.0~rc4 2 years ago
CMakePresetsTest New upstream version 3.27.0~rc4 2 years ago
CMakePresetsWorkflow New upstream version 3.27.0~rc4 2 years ago
CMakeRelease New upstream version 3.24.0 3 years ago
CMakeRoleGlobalProperty New upstream version 3.15.4 5 years ago
CPack New upstream version 3.30.0 7 months ago
CPackCommandLine New upstream version 3.16.3 5 years ago
CPackConfig New upstream version 3.29.2 10 months ago
CPackInstallProperties New upstream version 3.27.0~rc4 2 years ago
CPackSymlinks New upstream version 3.27.0~rc4 2 years ago
CPack_NuGet New upstream version 3.30.0 7 months ago
CPack_WIX New upstream version 3.30.0 7 months ago
CSharpCustomCommand New upstream version 3.27.0~rc4 2 years ago
CSharpReferenceImport New upstream version 3.27.0~rc4 2 years ago
CTest New upstream version 3.27.0~rc4 2 years ago
CTestCommandExpandLists New upstream version 3.26.4 2 years ago
CTestCommandLine New upstream version 3.30.0 7 months ago
CTestResourceAllocation New upstream version 3.30.0 7 months ago
CTestTimeout New upstream version 3.28.1 1 year ago
CTestTimeoutAfterMatch New upstream version 3.27.0~rc4 2 years ago
CUDA_architectures New upstream version 3.28.0 1 year ago
CXXModules New upstream version 3.30.0 7 months ago
CacheNewline New upstream version 3.27.0~rc4 2 years ago
CheckCompilerFlag New upstream version 3.29.2 10 months ago
CheckIPOSupported New upstream version 3.30.0 7 months ago
CheckLinkerFlag New upstream version 3.25.0 2 years ago
CheckModules New upstream version 3.27.0~rc4 2 years ago
CheckSourceCompiles New upstream version 3.29.2 10 months ago
CheckSourceRuns New upstream version 3.29.2 10 months ago
ClangTidy New upstream version 3.27.0~rc4 2 years ago
Color New upstream version 3.27.0~rc4 2 years ago
CommandLine New upstream version 3.30.0 7 months ago
CommandLineTar New upstream version 3.27.0~rc4 2 years ago
CompatibleInterface New upstream version 3.27.0~rc4 2 years ago
CompileDefinitions New upstream version 3.29.2 10 months ago
CompileFeatures New upstream version 3.30.0 7 months ago
CompileWarningAsError New upstream version 3.29.2 10 months ago
CompilerArgs New upstream version 3.27.0~rc4 2 years ago
CompilerChange New upstream version 3.29.2 10 months ago
CompilerLauncher New upstream version 3.27.0~rc4 2 years ago
CompilerNotFound New upstream version 3.29.2 10 months ago
CompilerTest New upstream version 3.25.0 2 years ago
Configure New upstream version 3.30.0 7 months ago
Cppcheck New upstream version 3.27.0~rc4 2 years ago
Cpplint New upstream version 3.27.0~rc4 2 years ago
CrosscompilingEmulator New upstream version 3.29.2 10 months ago
DependencyGraph New upstream version 3.28.0 1 year ago
DependencyProviders New upstream version 3.29.2 10 months ago
DisallowedCommands New upstream version 3.27.0~rc4 2 years ago
ExcludeFromAll New upstream version 3.29.2 10 months ago
ExportCompileCommands New upstream version 3.21.2 3 years ago
ExportImport New upstream version 3.26.4 2 years ago
ExportWithoutLanguage New upstream version 3.21.2 3 years ago
ExternalData New upstream version 3.27.0~rc4 2 years ago
ExternalProject New upstream version 3.30.1 6 months ago
ExtraGenerators New upstream version 3.27.0~rc4 2 years ago
FPHSA New upstream version 3.30.0 7 months ago
FeatureSummary New upstream version 3.27.0~rc4 2 years ago
FetchContent New upstream version 3.30.0 7 months ago
FetchContent_find_package New upstream version 3.30.0 7 months ago
FileAPI New upstream version 3.30.0 7 months ago
FileAPIExternalSource New upstream version 3.21.2 3 years ago
File_Archive New upstream version 3.27.0~rc4 2 years ago
File_Configure New upstream version 3.25.0 2 years ago
File_Generate New upstream version 3.29.2 10 months ago
FindBoost New upstream version 3.30.0 7 months ago
FindGTK2 New upstream version 3.27.0~rc4 2 years ago
FindLua New upstream version 3.27.0~rc4 2 years ago
FindMatlab New upstream version 3.27.0~rc4 2 years ago
FindOpenGL New upstream version 3.29.2 10 months ago
FindOpenSSL New upstream version 3.27.0~rc4 2 years ago
FindPkgConfig New upstream version 3.30.0 7 months ago
FindSWIG New upstream version 3.27.0~rc4 2 years ago
Framework New upstream version 3.29.2 10 months ago
GNUInstallDirs New upstream version 3.27.0~rc4 2 years ago
GenEx-COMPILE_LANGUAGE New upstream version 3.27.0~rc4 2 years ago
GenEx-COMPILE_LANG_AND_ID New upstream version 3.21.2 3 years ago
GenEx-DEVICE_LINK New upstream version 3.21.2 3 years ago
GenEx-GENEX_EVAL New upstream version 3.18.2 4 years ago
GenEx-HOST_LINK New upstream version 3.21.2 3 years ago
GenEx-LINK_GROUP New upstream version 3.24.2 2 years ago
GenEx-LINK_LANGUAGE New upstream version 3.21.2 3 years ago
GenEx-LINK_LANG_AND_ID New upstream version 3.21.2 3 years ago
GenEx-LINK_LIBRARY New upstream version 3.30.0 7 months ago
GenEx-LIST New upstream version 3.27.4 1 year ago
GenEx-PATH New upstream version 3.27.0~rc4 2 years ago
GenEx-PATH_EQUAL New upstream version 3.24.0 3 years ago
GenEx-TARGET_FILE New upstream version 3.27.0~rc4 2 years ago
GenEx-TARGET_IMPORT_FILE New upstream version 3.27.0~rc4 2 years ago
GenEx-TARGET_PROPERTY New upstream version 3.30.0 7 months ago
GenEx-TARGET_RUNTIME_DLLS New upstream version 3.27.0~rc4 2 years ago
GenerateExportHeader New upstream version 3.30.0 7 months ago
GeneratorExpression New upstream version 3.30.0 7 months ago
GeneratorExpressionShortCircuit New upstream version 3.28.0 1 year ago
GeneratorInstance New upstream version 3.26.4 2 years ago
GeneratorPlatform New upstream version 3.30.0 7 months ago
GeneratorToolset New upstream version 3.29.2 10 months ago
GetPrerequisites New upstream version 3.26.4 2 years ago
GoogleTest New upstream version 3.30.0 7 months ago
Graphviz New upstream version 3.29.2 10 months ago
IAR New upstream version 3.30.0 7 months ago
INSTALL_NAME_DIR New upstream version 3.18.2 4 years ago
IfacePaths New upstream version 3.27.0~rc4 2 years ago
IncludeWhatYouUse New upstream version 3.27.0~rc4 2 years ago
IncompatibleQt New upstream version 3.21.2 3 years ago
InitialFlags New upstream version 3.21.2 3 years ago
InstallParallel New upstream version 3.30.0 7 months ago
InterfaceLibrary New upstream version 3.27.0~rc4 2 years ago
LanguageStandards New upstream version 3.30.0 7 months ago
Languages New upstream version 3.27.0~rc4 2 years ago
LinkItemValidation New upstream version 3.27.0~rc4 2 years ago
LinkLibrariesProcessing New upstream version 3.30.0 7 months ago
LinkStatic New upstream version 3.27.0~rc4 2 years ago
LinkWhatYouUse New upstream version 3.27.0~rc4 2 years ago
LinkerLauncher New upstream version 3.27.0~rc4 2 years ago
LinkerSelection New upstream version 3.30.0 7 months ago
MSVCDebugInformationFormat New upstream version 3.25.0 2 years ago
MSVCRuntimeLibrary New upstream version 3.23.0 3 years ago
MSVCRuntimeTypeInfo New upstream version 3.28.0 1 year ago
MSVCWarningFlags New upstream version 3.23.0 3 years ago
MacOSVersions New upstream version 3.27.0~rc4 2 years ago
Make New upstream version 3.29.2 10 months ago
MaxRecursionDepth New upstream version 3.27.0~rc4 2 years ago
MetaCompileFeatures New upstream version 3.15.4 5 years ago
MultiLint New upstream version 3.27.7 1 year ago
Ninja New upstream version 3.29.2 10 months ago
NinjaMultiConfig New upstream version 3.29.2 10 months ago
NinjaPrivateDeps New upstream version 3.28.0 1 year ago
ObjectLibrary New upstream version 3.29.2 10 months ago
ObsoleteQtMacros New upstream version 3.21.2 3 years ago
ParseImplicitData New upstream version 3.29.2 10 months ago
ParseImplicitIncludeInfo New upstream version 3.29.2 10 months ago
ParseImplicitLinkInfo New upstream version 3.30.0 7 months ago
Policy New upstream version 3.21.2 3 years ago
PolicyScope New upstream version 3.27.0~rc4 2 years ago
PositionIndependentCode New upstream version 3.27.0~rc4 2 years ago
PrecompileHeaders New upstream version 3.29.2 10 months ago
PrintHelpers New upstream version 3.29.2 10 months ago
RunCPack New upstream version 3.30.0 7 months ago
RuntimePath New upstream version 3.29.2 10 months ago
ScriptMode New upstream version 3.13.1 6 years ago
SourceProperties New upstream version 3.29.2 10 months ago
Swift New upstream version 3.30.2 6 months ago
SymlinkTrees New upstream version 3.28.0 1 year ago
Syntax New upstream version 3.27.0~rc4 2 years ago
TIClang New upstream version 3.29.2 10 months ago
TargetArtifacts New upstream version 3.27.0~rc4 2 years ago
TargetObjects New upstream version 3.29.2 10 months ago
TargetPolicies New upstream version 3.30.0 7 months ago
TargetProperties New upstream version 3.27.0~rc4 2 years ago
ToolchainFile New upstream version 3.29.2 10 months ago
TransformDepfile New upstream version 3.29.2 10 months ago
UnityBuild New upstream version 3.29.2 10 months ago
UseSWIG New upstream version 3.29.2 10 months ago
VS10Project New upstream version 3.30.0 7 months ago
VS10ProjectUseDebugLibraries New upstream version 3.30.0 7 months ago
VS10ProjectWinCE New upstream version 3.16.3 5 years ago
VSSolution New upstream version 3.30.0 7 months ago
VerifyHeaderSets New upstream version 3.30.0 7 months ago
VisibilityPreset New upstream version 3.27.0~rc4 2 years ago
VsDotnetSdk New upstream version 3.27.0~rc4 2 years ago
VsNugetPackageRestore New upstream version 3.23.0 3 years ago
Win32GenEx New upstream version 3.21.2 3 years ago
WorkingDirectory New upstream version 3.15.4 5 years ago
WriteBasicConfigVersionFile New upstream version 3.21.2 3 years ago
WriteCompilerDetectionHeader New upstream version 3.28.0 1 year ago
XcFramework New upstream version 3.29.2 10 months ago
XcodeProject New upstream version 3.30.2 6 months ago
XcodeProject-Device New upstream version 3.29.2 10 months ago
XcodeProject-Embed New upstream version 3.29.2 10 months ago
add_compile_definitions New upstream version 3.29.2 10 months ago
add_custom_command New upstream version 3.30.0 7 months ago
add_custom_target New upstream version 3.30.0 7 months ago
add_dependencies New upstream version 3.29.2 10 months ago
add_executable New upstream version 3.27.0~rc4 2 years ago
add_library New upstream version 3.30.0 7 months ago
add_link_options New upstream version 3.27.0~rc4 2 years ago
add_subdirectory New upstream version 3.30.0 7 months ago
add_test New upstream version 3.29.2 10 months ago
alias_targets New upstream version 3.27.0~rc4 2 years ago
block New upstream version 3.25.0 2 years ago
build_command New upstream version 3.27.0~rc4 2 years ago
cmake_host_system_information New upstream version 3.30.0 7 months ago
cmake_language New upstream version 3.30.0 7 months ago
cmake_minimum_required New upstream version 3.27.0~rc4 2 years ago
cmake_parse_arguments New upstream version 3.27.0~rc4 2 years ago
cmake_path New upstream version 3.27.0~rc4 2 years ago
configure_file New upstream version 3.27.0~rc4 2 years ago
continue New upstream version 3.27.0~rc4 2 years ago
ctest_build New upstream version 3.28.0 1 year ago
ctest_cmake_error New upstream version 3.30.0 7 months ago
ctest_configure New upstream version 3.27.0~rc4 2 years ago
ctest_coverage New upstream version 3.27.0~rc4 2 years ago
ctest_disabled_test New upstream version 3.15.4 5 years ago
ctest_empty_binary_directory New upstream version 3.29.2 10 months ago
ctest_environment New upstream version 3.26.4 2 years ago
ctest_fixtures New upstream version 3.30.0 7 months ago
ctest_labels_for_subprojects New upstream version 3.29.2 10 months ago
ctest_memcheck New upstream version 3.28.0 1 year ago
ctest_skipped_test New upstream version 3.15.4 5 years ago
ctest_start New upstream version 3.27.0~rc4 2 years ago
ctest_submit New upstream version 3.30.0 7 months ago
ctest_test New upstream version 3.29.2 10 months ago
ctest_update New upstream version 3.27.0~rc4 2 years ago
ctest_upload New upstream version 3.30.0 7 months ago
define_property New upstream version 3.29.2 10 months ago
execute_process New upstream version 3.30.0 7 months ago
export New upstream version 3.29.2 10 months ago
file New upstream version 3.30.0 7 months ago
file-CHMOD New upstream version 3.25.0 2 years ago
file-DOWNLOAD New upstream version 3.30.2 6 months ago
file-GET_RUNTIME_DEPENDENCIES New upstream version 3.30.0 7 months ago
file-RPATH New upstream version 3.30.0 7 months ago
file-STRINGS New upstream version 3.29.2 10 months ago
find_dependency New upstream version 3.27.0~rc4 2 years ago
find_file New upstream version 3.29.2 10 months ago
find_library New upstream version 3.29.2 10 months ago
find_package New upstream version 3.30.0 7 months ago
find_path New upstream version 3.29.2 10 months ago
find_program New upstream version 3.29.2 10 months ago
foreach New upstream version 3.29.2 10 months ago
function New upstream version 3.18.2 4 years ago
get_filename_component New upstream version 3.27.0~rc4 2 years ago
get_property New upstream version 3.28.0 1 year ago
if New upstream version 3.29.2 10 months ago
include New upstream version 3.30.0 7 months ago
include_directories New upstream version 3.27.0~rc4 2 years ago
include_external_msproject New upstream version 3.30.0 7 months ago
include_guard New upstream version 3.15.4 5 years ago
install New upstream version 3.30.1 6 months ago
list New upstream version 3.27.0~rc4 2 years ago
load_cache New upstream version 3.18.2 4 years ago
math New upstream version 3.27.0~rc4 2 years ago
message New upstream version 3.27.0~rc4 2 years ago
no_install_prefix New upstream version 3.27.0~rc4 2 years ago
option New upstream version 3.21.2 3 years ago
project New upstream version 3.30.4 4 months ago
project_injected New upstream version 3.27.0~rc4 2 years ago
property_init New upstream version 3.30.0 7 months ago
return New upstream version 3.25.0 2 years ago
separate_arguments New upstream version 3.30.0 7 months ago
set New upstream version 3.28.0 1 year ago
set_property New upstream version 3.29.2 10 months ago
set_tests_properties New upstream version 3.28.0 1 year ago
string New upstream version 3.27.0~rc4 2 years ago
target_compile_definitions New upstream version 3.29.2 10 months ago
target_compile_features New upstream version 3.29.2 10 months ago
target_compile_options New upstream version 3.29.2 10 months ago
target_include_directories New upstream version 3.21.2 3 years ago
target_link_directories New upstream version 3.18.2 4 years ago
target_link_libraries New upstream version 3.29.2 10 months ago
target_link_libraries-ALIAS New upstream version 3.29.2 10 months ago
target_link_libraries-LINK_GROUP New upstream version 3.29.2 10 months ago
target_link_libraries-LINK_LANGUAGE New upstream version 3.29.2 10 months ago
target_link_libraries-LINK_LANG_AND_ID New upstream version 3.29.2 10 months ago
target_link_libraries-LINK_LIBRARY New upstream version 3.30.0 7 months ago
target_link_options New upstream version 3.28.0 1 year ago
target_sources New upstream version 3.29.2 10 months ago
test_include_dirs New upstream version 3.26.4 2 years ago
try_compile New upstream version 3.30.0 7 months ago
try_run New upstream version 3.29.2 10 months ago
variable_watch New upstream version 3.27.0~rc4 2 years ago
while New upstream version 3.27.0~rc4 2 years ago
AddRunCMakeTest.cmake New upstream version 3.27.0~rc4 2 years ago
CMakeLists.txt New upstream version 3.30.0 7 months ago
FileAPIDummyFile.cmake New upstream version 3.15.4 5 years ago
README.rst New upstream version 3.30.0 7 months ago
RunCMake.cmake New upstream version 3.30.0 7 months ago
RunCPack.cmake New upstream version 3.30.0 7 months ago
RunCTest.cmake New upstream version 3.29.2 10 months ago
color_warning.c New upstream version 3.16.3 5 years ago
detect_jobserver.c New upstream version 3.30.0 7 months ago
exit_code.c New upstream version 3.18.2 4 years ago
exit_crash.c New upstream version 3.30.0 7 months ago
fake_build_command.c New upstream version 3.21.2 3 years ago
print_stdin.c New upstream version 3.29.2 10 months ago
pseudo_cppcheck.c New upstream version 3.18.2 4 years ago
pseudo_cpplint.c New upstream version 3.8.0 8 years ago
pseudo_emulator.c New upstream version 3.29.2 10 months ago
pseudo_emulator_custom_command.c New upstream version 3.8.0 8 years ago
pseudo_emulator_custom_command_arg.c New upstream version 3.15.4 5 years ago
pseudo_iwyu.c New upstream version 3.8.0 8 years ago
pseudo_llvm-rc.c New upstream version 3.23.0 3 years ago
pseudo_tidy.c New upstream version 3.26.4 2 years ago
showIncludes.c New upstream version 3.29.2 10 months ago
testStartupInfo.c New upstream version 3.29.4 8 months ago

README.rst

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`_ and the `CMake Source Code Guide`_.

.. _`../README.rst`: ../README.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 ``/``.

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

3. Create script ``/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 ``/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 ``/.cmake`` file for each case named
above containing the actual test code. Optionally create files
containing expected test results:

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

To specify platform-specific matches, create files of the form
``-{stdout,stderr}-.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 ``-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()``
Run CMake or another command and check expected results described by
``-{result,stdout,stderr}.txt`` and ``-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( ...)``
Sets ``RunCMake_TEST_COMMAND`` to ``;...``
and calls ``run_cmake()``.

This is useful to run an arbitrary command.

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

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

``run_cmake_with_options( ...)``
Sets ``RunCMake_TEST_OPTIONS`` to ``...``
and calls ``run_cmake()``.

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

execute_process(
COMMAND ${RunCMake_TEST_COMMAND} ${RunCMake_TEST_OPTIONS}
...
)

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/`` 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/`` 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}/-build``.

``RunCMake_TEST_NO_CLEAN``
Boolean value indicating whether ``run_cmake()`` 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()`` to execute.
If not set, defaults to running CMake to generate a project::

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

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

``RunCMake_TEST_OPTIONS``
Additional command-line options for ``run_cmake()`` 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()`` should redirect
the test process's ``stderr`` into its ``stdout``.

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

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

Normally each ``run_cmake()`` 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= -P Tests/RunCMake/AddRunCMakeTestSuite.cmake

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