CMake/Tests/RunCMake
Brad King 29b5ca108e Merge topic 'remove_error_read_script'
6bf13097 CTest: Drop "Error in read script" message at end of testing
2015-02-27 10:34:38 -05:00
..
CMP0004
CMP0019 RunCMake: Expect empty output by default. 2014-12-31 16:34:34 +01:00
CMP0022 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0026 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0027
CMP0028 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0037 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0038 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0039 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0040 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0041 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0042 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0043 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0045 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0046 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0049 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0050 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0051
CMP0053
CMP0054 If: Introduce policy CMP0054 - don't dereference quoted variables in if() 2014-09-11 21:23:17 +02:00
CMP0055 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CPackInstallProperties
CPackRPM CPackRPM: Allow multiple path relocation prefixes for one package 2015-01-29 10:48:58 -05:00
CTest
CheckModules RunCMake: Expect empty output by default. 2014-12-31 16:34:34 +01:00
CommandLine Tests: Extend RunCMake.CommandLine to cover 'cmake --build' for 'ninja -v' 2015-02-26 10:21:09 -05:00
CompatibleInterface
CompileFeatures RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CompilerChange
CompilerNotFound
Configure
DisallowedCommands RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
ExportWithoutLanguage
ExternalData ExternalData: Add support for custom algorithm-to-URL mapping 2015-02-25 08:28:05 -05:00
ExternalProject ExternalProject: Add unit tests 2014-11-03 16:15:14 +01:00
FPHSA RunCMake: Expect empty output by default. 2014-12-31 16:34:34 +01:00
FeatureSummary FeatureSummary: Print each feature info only once 2015-02-23 11:39:17 -05:00
File_Generate cmGlobalGenerator: Convert set insert algorithm to vector algorithms. 2015-02-20 21:36:57 +01:00
FindPkgConfig Tests: Fix CMP0054 warnings 2014-09-16 09:06:29 -04:00
GeneratorExpression RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
GeneratorPlatform Tests: Test setting a generator platform in a toolchain file 2014-09-15 10:27:00 -04:00
GeneratorToolset
IfacePaths Allow export of targets with INTERFACE_SOURCES. 2015-02-11 00:51:34 +01:00
IncompatibleQt
Languages RunCMake: Expect empty output by default. 2014-12-31 16:34:34 +01:00
ObjectLibrary
ObsoleteQtMacros
PositionIndependentCode
SolutionGlobalSections
Syntax RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
TargetObjects
TargetPolicies
TargetPropertyGeneratorExpressions RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
TargetSources Allow export of targets with INTERFACE_SOURCES. 2015-02-11 00:51:34 +01:00
VisibilityPreset
WriteCompilerDetectionHeader WCDH: Make it possible to generate multiple files. 2014-11-24 21:54:41 +01:00
XcodeProject OS X: Add platform-specific Frameworks search path 2015-02-23 13:10:52 -05:00
add_custom_command Add an option for explicit BYPRODUCTS of custom commands (#14963) 2014-11-14 16:16:00 -05:00
add_custom_target Add an option for explicit BYPRODUCTS of custom commands (#14963) 2014-11-14 16:16:00 -05:00
add_dependencies
alias_targets
build_command
cmake_minimum_required
configure_file configure_file: Test that CMake re-runs on input change or output missing 2015-01-27 11:18:37 -05:00
continue continue: Add a new CMake language command for loop continuation (#14013) 2014-12-01 09:50:49 -05:00
ctest_build ctest_build: Add QUIET option 2015-02-23 10:01:59 -05:00
ctest_configure ctest_configure: Add QUIET option 2015-02-23 10:01:59 -05:00
ctest_coverage ctest_coverage: Add QUIET option 2015-02-23 10:02:00 -05:00
ctest_memcheck CTest: Drop "Error in read script" message at end of testing 2015-02-27 10:31:02 -05:00
ctest_start ctest_start: Add QUIET option 2015-02-23 10:01:59 -05:00
ctest_submit CTest: Drop "Error in read script" message at end of testing 2015-02-27 10:31:02 -05:00
ctest_test ctest_test: Add QUIET option 2015-02-23 10:01:59 -05:00
ctest_upload ctest_upload: Add QUIET option 2015-02-23 10:02:00 -05:00
export
file file: Add LOCK subcommand to do file and directory locking 2014-12-03 09:47:44 -05:00
find_dependency
find_file Teach find_(library|file|path) to get prefixes from PATH (#15370) 2015-02-19 10:03:17 -05:00
find_library Teach find_(library|file|path) to get prefixes from PATH (#15370) 2015-02-19 10:03:17 -05:00
find_package
find_path Teach find_(library|file|path) to get prefixes from PATH (#15370) 2015-02-19 10:03:17 -05:00
get_filename_component
get_property tests: add tests for querying properties 2015-01-11 11:45:44 -05:00
if
include
include_directories Tests: Split part of include_directories test to a generic location. 2015-02-09 19:23:47 +01:00
include_external_msproject Tests: Add generator platform support 2014-09-10 11:21:50 -04:00
install install: Allow generator expressions in TARGETS DESTINATION (#14317) 2015-02-11 15:15:33 -05:00
interface_library RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
list
message RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
no_install_prefix RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
project RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
return return: Add test for returning inside a foreach loop 2014-11-25 14:37:39 -05:00
set Merge branch 'parent-scope-tests' into variable-pull-failure 2014-10-24 13:34:30 -04:00
string file: Teach STRINGS to support UTF-16 and UTF-32 encodings 2015-01-27 11:30:26 -05:00
target_compile_features
target_link_libraries
try_compile Merge topic 'test-rerun-cmake' 2015-01-27 11:22:06 -05:00
try_run try_run: Add test for bad link libraries. 2015-01-26 10:05:30 -05:00
variable_watch
CMakeLists.txt Merge topic 'osx-framework-search-platform-SDKs' 2015-02-24 09:12:45 -05:00
README.rst Tests: Split RunCTest helper out of RunCMake.CTest(Submit|Memcheck) 2015-02-19 11:26:44 -05:00
RunCMake.cmake Tests: Teach RunCMake to tolerate 'Error kstat returned' lines in test output 2015-02-23 10:01:58 -05:00
RunCTest.cmake Tests: Split RunCTest helper out of RunCMake.CTest(Submit|Memcheck) 2015-02-19 11:26:44 -05: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``.