CMake/Tests/RunCMake
Brad King 88e1c54a7c Merge topic 'use-string-append'
7a649111 Use string(APPEND) in Tests
5d0d980d Use string(APPEND) in Modules
2016-08-01 14:59:50 -04:00
..
AutoExportDll VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries 2016-07-21 11:05:22 -04:00
BuildDepends Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
CMP0004
CMP0019
CMP0022 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0026 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0027
CMP0028
CMP0037 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0038 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0039
CMP0040 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0041 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0042 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0043 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0045 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0046 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0049 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0050 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0051 Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CMP0053
CMP0054 Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
CMP0055
CMP0057
CMP0059 CMP0059: Fix typo in policy description 2016-05-02 15:16:07 -04:00
CMP0060
CMP0064 CMP0064: Fix recorded version of introduction to be 3.4 2015-09-21 10:05:02 -04:00
CMP0065 Fix typos. 2016-07-10 11:05:56 +02:00
COMPILE_LANGUAGE-genex Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CPack Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
CPackConfig Introduction of CPACK_VERBATIM_VARIABLES variable 2015-09-20 23:39:03 +02:00
CPackInstallProperties Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CPackSymlinks
CTest
CTestCommandLine CTest: Fix regression in handling of a RUN_SERIAL test that fails 2015-10-23 09:55:25 -04:00
CTestTimeoutAfterMatch CTest: Optionally use a secondary test timeout after matching output 2016-03-22 11:17:55 -04:00
CheckModules
ClangTidy Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CommandLine cmake: Add an option to control what files needs to be traced 2016-06-17 11:46:23 -04:00
CommandLineTar
CompatibleInterface Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CompileDefinitions
CompileFeatures Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CompilerChange
CompilerLauncher Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CompilerNotFound
Configure
CrosscompilingEmulator Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
DisallowedCommands
ExportWithoutLanguage Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
ExternalData
ExternalProject
FPHSA
FeatureSummary
File_Generate Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
FindMatlab Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
FindPkgConfig Teach find_library and find_package to search lib32 paths (#11260) 2016-06-10 11:09:16 -04:00
Framework Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
GNUInstallDirs
GeneratorExpression Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134) 2016-06-02 10:58:38 -04:00
GeneratorPlatform
GeneratorToolset
IfacePaths
IncludeWhatYouUse Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
IncompatibleQt Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
Languages Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
LinkStatic
LinkWhatYouUse Add options to run `ldd -u -r` as a "link-what-you-use" tool 2016-06-17 10:56:40 -04:00
Make
Ninja Tests: Select RunCMake.Ninja test cases based on ninja version 2016-05-18 09:24:54 -04:00
ObjectLibrary Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
ObsoleteQtMacros Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
PolicyScope cmListFileBacktrace: Refactor storage to provide efficient value semantics 2016-04-18 09:21:19 -04:00
PositionIndependentCode Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
Swift
Syntax Parser: Issue file open error messages through dedicated API 2016-06-13 20:19:16 +02:00
TargetObjects
TargetPolicies Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
TargetPropertyGeneratorExpressions Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
TargetSources Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
ToolchainFile Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files 2016-07-14 15:47:32 -04:00
VS10Project Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
VSSolution VS: Fix default target support for targets nested inside a folder 2016-03-23 13:22:15 -04:00
VisibilityPreset CMP0063: Split unit test by target type. 2015-10-20 23:58:48 +02:00
WriteCompilerDetectionHeader
XcodeProject Add tests for BUNDLE_EXTENSION 2016-07-21 23:18:56 -07:00
add_custom_command add_custom_command: Clarify error when TARGET is out of scope (#15681) 2016-01-28 10:33:26 -05:00
add_custom_target Ninja: Fix inter-target order-only dependencies of custom commands 2016-07-20 13:12:24 -04:00
add_dependencies
add_subdirectory Tests: Add case for add_subdirectory inside a function 2015-11-23 10:52:51 -05:00
alias_targets Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
build_command
cmake_minimum_required
cmake_parse_arguments cmake_parse_arguments: Additional regression tests 2016-02-24 10:07:30 -05:00
configure_file
continue Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
ctest_build
ctest_configure
ctest_coverage
ctest_memcheck
ctest_start
ctest_submit Tests: Extend ctest_submit host lookup failure matching (#15958) 2016-02-08 09:25:21 -05:00
ctest_test Tests: Disable parallel test execution while running ctest_test 2015-10-27 21:44:04 +01:00
ctest_upload
execute_process
export
file file: Sort GLOB results to make it deterministic (#14491) 2016-05-17 10:12:11 -04:00
find_dependency
find_file Drop find_(library|file|path) prefixes from PATH on non-Windows 2016-05-09 12:58:08 -04:00
find_library Drop find_(library|file|path) prefixes from PATH on non-Windows 2016-05-09 12:58:08 -04:00
find_package cmListFileBacktrace: Refactor storage to provide efficient value semantics 2016-04-18 09:21:19 -04:00
find_path find_path: Fix location of <dir/header.h> in a framework on OS X 2016-06-07 09:04:35 -04:00
find_program Merge topic 'fix-find_program-regression' 2015-11-02 09:09:46 -05:00
get_filename_component
get_property
if Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
include Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
include_directories
include_external_msproject Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
install Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
interface_library
list list: Add FILTER subcommand (#3986) 2016-02-03 11:13:17 -05:00
message cmake: Issue message independent of cmMakefile definition 2016-06-12 18:38:33 +02:00
no_install_prefix
project
return
set
set_property
string
target_compile_features Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
target_link_libraries Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
try_compile try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG> 2016-06-29 09:11:02 -04:00
try_run Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
variable_watch
while cmListFileBacktrace: Refactor storage to provide efficient value semantics 2016-04-18 09:21:19 -04:00
CMakeLists.txt Tests: Hide errors from `ldd --help` output check 2016-07-21 15:39:05 -04:00
README.rst
RunCMake.cmake Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
RunCTest.cmake
pseudo_emulator.c Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
pseudo_emulator_custom_command.c Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
pseudo_iwyu.c
pseudo_tidy.c Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00

README.rst

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``
    Process result expected 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 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``.