CMake/Tests/RunCMake
2020-01-17 23:17:35 +01:00
..
add_custom_command add_custom_command: Format files in error message in a single line 2019-09-23 23:39:07 +02:00
add_custom_target add_custom_command: Format files in error message in a single line 2019-09-23 23:39:07 +02:00
add_dependencies
add_executable cmake: Display error if generate step fails 2019-05-13 10:31:39 -04:00
add_library target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets 2019-07-22 10:23:39 -04:00
add_link_options Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
add_subdirectory Tests: Cover EXCLUDE_FROM_ALL OFF on sub/sub/tgt in sub/all 2019-09-30 10:34:23 -04:00
alias_targets
Android Android: Use unified toolchain in NDK r19+ 2019-07-26 14:17:07 -04:00
AndroidMK
AndroidTestUtilities
AutoExportDll Revise include order using clang-format-6.0 2019-10-01 12:26:36 -04:00
Autogen
build_command
BuildDepends Makefile: Fix regression in dependencies on relative includes 2019-07-24 11:37:31 -04:00
BundleUtilities
Byproducts
CacheNewline
CheckIPOSupported Add deprecation warnings for policies CMP0069 and below 2019-10-10 09:26:10 -04:00
CheckModules
ClangTidy
cmake_minimum_required
cmake_parse_arguments
CMakeRoleGlobalProperty
CMP0004
CMP0019
CMP0022
CMP0026
CMP0027
CMP0028
CMP0037
CMP0038
CMP0039
CMP0040
CMP0041
CMP0042
CMP0043
CMP0045
CMP0046
CMP0049
CMP0050
CMP0051
CMP0053
CMP0054
CMP0055
CMP0057
CMP0059
CMP0060
CMP0064
CMP0065 AIX: Explicitly compute executable exports for both XL and GNU 2019-07-15 13:27:16 -04:00
CMP0068 Add deprecation warnings for policies CMP0069 and below 2019-10-10 09:26:10 -04:00
CMP0069 Add deprecation warnings for policies CMP0069 and below 2019-10-10 09:26:10 -04:00
CMP0081
CommandLine Merge topic 'trace-test-support-python26-and-older' 2020-01-03 11:28:29 -05:00
CommandLineTar Merge topic 'tar-zstd-compression' 2019-05-30 09:39:35 -04:00
CompatibleInterface
CompileDefinitions
CompileFeatures
CompilerChange
CompilerLauncher ObjC: Add _COMPILE_LAUNCHER support 2020-01-09 13:52:37 -05:00
CompilerNotFound
Configure VS: Fix access violation when calling Visual Studio macro 2019-09-24 17:44:28 +02:00
configure_file
continue
CPack Merge topic 'fix-cpack-deb-description-file' 2020-01-13 10:23:26 -05:00
CPackCommandLine Tests: Add RunCMake.CPackCommandLine case for multi-config package 2019-11-11 14:16:48 -05:00
CPackConfig
CPackInstallProperties
CPackSymlinks
Cppcheck
Cpplint
CrosscompilingEmulator Fix allocation in CROSSCOMPILING_EMULATOR evaluation 2019-07-23 08:33:31 -04:00
CSharpCustomCommand
CSharpReferenceImport
CTest
ctest_build ctest_build: ignore ANSI color 2019-08-22 15:53:42 -04:00
ctest_cmake_error
ctest_configure
ctest_coverage
ctest_disabled_test
ctest_fixtures
ctest_labels_for_subprojects Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
ctest_memcheck
ctest_skipped_test
ctest_start ctest: rename TRACK to GROUP 2019-08-22 13:10:18 -04:00
ctest_submit ctest_submit: Add option BUILD_ID 2019-03-22 09:37:08 -04:00
ctest_test ctest_test: Add option to REPEAT tests 2019-11-07 14:21:18 -05:00
ctest_update Tests: Fix RunCMake.ctest_update test to not require GIT_EXECUTABLE 2019-06-04 12:27:32 -04:00
ctest_upload
CTestCommandExpandLists add_test: Add COMMAND_EXPAND_LISTS option 2019-06-07 13:14:29 -04:00
CTestCommandLine ctest: Populate CTEST_CONFIGURATION_TYPE from the -C command line when set 2019-12-09 13:10:59 -05:00
CTestResourceAllocation Merge topic 'ctest-resource-allocation-spec-message' 2019-12-28 19:03:00 -05:00
CTestTimeout CTest: Fix timeout when grandchild keeps pipes open 2020-01-14 10:29:05 -05:00
CTestTimeoutAfterMatch
DisallowedCommands
execute_process execute_process: Add option to echo command lines 2019-04-19 13:32:08 -04:00
export Tests: add tests for export set error messages 2019-06-27 10:57:34 -04:00
ExportWithoutLanguage
ExternalData
ExternalProject
FeatureSummary
FetchContent
file Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
File_Generate Relax the usage of TARGET_OBJECTS generator expression 2019-04-19 13:52:50 -04:00
FileAPI Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
FileAPIExternalSource fileapi: add some source property backtraces 2019-09-26 10:56:52 -04:00
find_dependency
find_file find_*: Use debug logging infrastructure 2019-12-19 08:09:49 -05:00
find_library find_*: Use debug logging infrastructure 2019-12-19 08:09:49 -05:00
find_package find_package: Improve debug logging output 2020-01-01 15:00:42 -05:00
find_path find_*: Use debug logging infrastructure 2019-12-19 08:09:49 -05:00
find_program find_*: Use debug logging infrastructure 2019-12-19 08:09:49 -05:00
FindBoost Merge topic 'FindBoost-1.71' 2019-09-03 09:23:48 -04:00
FindGTK2
FindLua
FindMatlab
FindOpenGL
FindPkgConfig FindPkgConfig: Allow libraries that can't be found with their full path 2019-09-16 13:02:08 -04:00
foreach foreach: Allow multiple iteration variables for ZIP_LIST mode 2019-12-07 18:03:20 +02:00
FPHSA FPHSA: add capability to specify message explaining reason of failure 2019-09-27 16:04:54 +02:00
Framework Tests: Match file command output for older macOS (Framework test) 2019-10-27 23:48:41 +11:00
function cmFunctionCommand: Introduce CMAKE_CURRENT_FUNCTION* variables 2019-12-10 16:43:27 +02:00
GenerateExportHeader Revise include order using clang-format-6.0 2019-10-01 12:26:36 -04:00
GeneratorExpression AIX: Create import library for executables with exports 2019-07-16 14:15:13 -04:00
GeneratorInstance
GeneratorPlatform VS: Provide the default platform name to project code 2019-04-19 07:46:13 -04:00
GeneratorToolset VS: Add support to override VCTargetsPath through toolset 2019-10-15 13:28:45 -04:00
get_filename_component
get_property Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
GetPrerequisites
GNUInstallDirs
GoogleTest
Graphviz Graphviz: added test suite, fixes, enhancements 2019-10-08 13:45:56 +11:00
if
IfacePaths Tests: Shorten name RunCMake.IfacePaths_{INCLUDE_DIRECTORIES => INCDIRS} 2019-10-01 10:53:39 -04:00
include
include_directories
include_external_msproject
include_guard
IncludeWhatYouUse
IncompatibleQt
install Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
INSTALL_NAME_DIR Tests: Add tests for INSTALL_NAME_DIR 2019-11-04 19:02:16 -05:00
interface_library INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties 2019-04-11 11:09:42 -04:00
Languages
LinkStatic
LinkWhatYouUse
list list(POP_FRONT): Fix always assigning first item to output vars 2019-06-30 13:15:29 +03:00
load_cache load_cache: Allow READ_WITH_PREFIX mode in cmake scripts 2019-11-19 14:39:00 -05:00
Make
math math(EXPR): Implement ~(exp_NOT) expression as documented 2019-07-23 07:33:50 -04:00
MaxRecursionDepth Refactor: Modernize cmVariableWatchCommand a little 2019-10-17 09:38:31 -04:00
message Merge topic 'message-check-types' 2019-11-04 14:11:45 -05:00
MetaCompileFeatures Add a test to verify meta-feature parity with granular features 2019-04-09 08:44:56 -04:00
MSVCRuntimeLibrary cmake: Display error if generate step fails 2019-05-13 10:31:39 -04:00
MSVCWarningFlags MSVC: Do not add /W3 to CMAKE_<LANG>_FLAGS by default 2019-04-19 12:56:49 -04:00
MultiLint
Ninja Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
NinjaMultiConfig Merge topic 'ninja_multi_config_support_cuda' 2020-01-14 15:11:35 -05:00
no_install_prefix
ObjectLibrary Unity: Proper handling of object libraries 2019-12-07 15:44:38 +01:00
ObsoleteQtMacros
option
ParseImplicitData replace remove and remove_directory with rm in tests 2019-11-13 18:02:18 -05:00
ParseImplicitIncludeInfo CMakeParseImplicitLinkInfo supports comma separated link lines 2019-08-28 10:39:53 -04:00
ParseImplicitLinkInfo CMakeParseImplicitLinkInfo supports comma separated link lines 2019-08-28 10:39:53 -04:00
PolicyScope Genex: CompilerId now can match against a list of ids. 2019-06-03 10:20:23 -04:00
PositionIndependentCode
PrecompileHeaders Multi-Ninja: Add precompile headers support 2020-01-17 23:17:35 +01:00
project project: Fix potential buffer write-past-end for version components 2019-10-26 17:50:24 +11:00
project_injected cmMakefile: Enforce explicit use of project() command 2019-05-06 10:58:10 +02:00
return
RuntimePath Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
ScriptMode
separate_arguments
set
set_property
SourceProperties
string string: introduce REPEAT sub-command 2019-04-15 11:06:06 -04:00
Swift Swift: disallow WIN32_EXECUTABLE properties 2019-06-03 14:05:10 -04:00
Syntax cmListFileCache: When missing ending ) print starting line instead of last one 2019-06-03 10:03:53 -04:00
target_compile_definitions target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets 2019-07-22 10:23:39 -04:00
target_compile_features
target_compile_options target_compile_options: ensure BEFORE keyword is handled in all scopes 2020-01-11 01:25:25 +01:00
target_include_directories
target_link_directories Link properties: must be transitive over private dependency on static library 2019-12-09 11:29:36 -05:00
target_link_libraries target_link_libraries: Fix out-of-dir calls with debug/optimized keywords 2020-01-10 11:40:34 -05:00
target_link_options Ninja: Add multi-config variant 2019-12-13 10:51:46 -05:00
target_sources
TargetObjects Relax the usage of TARGET_OBJECTS generator expression 2019-04-19 13:52:50 -04:00
TargetPolicies Link properties: must be transitive over private dependency on static library 2019-12-09 11:29:36 -05:00
TargetProperties Add set_property option: DEPRECATION 2020-01-02 17:11:31 -05:00
TargetPropertyGeneratorExpressions cmake: Display error if generate step fails 2019-05-13 10:31:39 -04:00
TargetSources VS: Add support for per-config sources 2019-10-17 14:05:39 -04:00
test_include_dirs
ToolchainFile Restore support for include_directories() in toolchain files 2019-03-25 11:48:17 -04:00
try_compile cmCoreTryCompile::CleanupFiles now removes symlinks instead of their contents. 2019-12-26 17:39:36 +01:00
try_run Tests: fix failures with gnu mode clang on windows 2019-05-24 08:43:42 +02:00
UnityBuild Unity Build: include language in generated source file name 2020-01-14 18:48:08 +01:00
UseSWIG FindPython*: Manage weak link for Python modules 2019-05-07 16:37:24 +02:00
variable_watch
VisibilityPreset The error message for VISIBILITY_PRESET now documents valid options. 2019-06-03 09:56:03 -04:00
VS10Project Multi-Ninja: Add precompile headers support 2020-01-17 23:17:35 +01:00
VS10ProjectWinCE VS10Generator: add project properties to enable WindowsCE deployment. 2019-06-19 15:11:57 -07:00
VSSolution
while
WorkingDirectory
WriteBasicConfigVersionFile
WriteCompilerDetectionHeader
XcodeProject Multi-Ninja: Add precompile headers support 2020-01-17 23:17:35 +01:00
CMakeLists.txt Merge topic 'ctest-timeout-on-pipe' 2020-01-15 13:35:51 -05:00
color_warning.c ctest_build: ignore ANSI color 2019-08-22 15:53:42 -04:00
exit_code.c
FileAPIDummyFile.cmake
print_stdin.c
pseudo_cppcheck.c
pseudo_cpplint.c
pseudo_emulator_custom_command_arg.c Teach CROSSCOMPILING_EMULATOR to support arguments 2019-06-03 10:17:17 -04:00
pseudo_emulator_custom_command.c
pseudo_emulator.c
pseudo_iwyu.c
pseudo_tidy.c
README.rst RunCMake: Automatically support platform out override files 2019-06-21 11:06:39 -04:00
RunCMake.cmake Tests: Teach RunCMake to ignore PGI license expiry warnings 2019-11-01 09:23:03 -04:00
RunCTest.cmake

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``.