CMake/Tests/RunCMake
Stephen Kelly 5de63265e3 Genex: Only evaluate TARGET_OBJECTS to determine target sources.
The output of this expression may contain macros for IDEs to replace
such as $(Configuration), $(CURRENT_ARCH) etc.  To avoid generating
content which is not usable in other contexts, report an error if
there is an attempt to use it in other contexts.

This commit may be reverted in the future if a solution to the
above difference is implemented.
2014-04-02 23:12:57 +02:00
..
CMP0004
CMP0019
CMP0022 OS X: Add CMP0042 to enable MACOSX_RPATH by default 2014-01-02 13:41:49 -05:00
CMP0026 cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0027
CMP0028 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0037 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0038
CMP0039 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0040 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0041 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0042 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0043 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0045 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0046 cmTarget: Don't create duplicate backtraces in CMP0046 warning 2014-03-12 18:01:26 +01:00
CMP0049 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0050 Tests: Simplify and document policy scopes in RunCMake.CMP* tests 2014-03-06 11:07:03 -05:00
CMP0051 cmTarget: Include TARGET_OBJECTS genex in target SOURCES property. 2014-04-02 23:12:56 +02:00
CTest
CheckModules CheckTypeSize: Add unit test to cover the no-C case 2014-03-17 17:36:14 +01:00
CommandLine
CompatibleInterface
CompilerChange
CompilerNotFound
Configure
DisallowedCommands
ExportWithoutLanguage
ExternalData
FPHSA
FeatureSummary
File_Generate
FindPkgConfig FindPkgConfig: More unit tests 2014-03-17 18:10:59 +01:00
GeneratorExpression
GeneratorToolset
IncompatibleQt
Languages
ObjectLibrary cmGeneratorTarget: Compute consumed object libraries on demand. 2014-04-02 23:12:56 +02:00
ObsoleteQtMacros
PositionIndependentCode
SolutionGlobalSections
Syntax
TargetObjects Genex: Only evaluate TARGET_OBJECTS to determine target sources. 2014-04-02 23:12:57 +02:00
TargetPolicies
TargetPropertyGeneratorExpressions
VisibilityPreset
add_dependencies
alias_targets
build_command
cmake_minimum_required
configure_file Unicode: check encoding of files given to configure_file. 2014-03-17 14:01:55 -06:00
export
find_dependency Tests: Check find_dependency empty extra arguments 2014-03-13 15:57:03 -04:00
find_package
get_filename_component
if
include
include_directories
include_external_msproject
install
interface_library Disallow INTERFACE libraries with add_custom_command(TARGET). 2014-03-19 15:51:21 +01:00
list
message
no_install_prefix
project
set
string
target_link_libraries
try_compile
variable_watch
CMakeLists.txt cmTarget: Include TARGET_OBJECTS genex in target SOURCES property. 2014-04-02 23:12:56 +02:00
README.rst
RunCMake.cmake

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.

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