CMake/Tests/RunCMake
Ben Boeckel a9bdef2dda tests: Add variable expansion tests
There are some corner cases in variable expansion which would be nice to
capture before going and rewriting the variable expansion code. The
majority of these are related to configuring files and strings with '@'
in them in conjunction with @ONLY being specified. Another is testing
for '(' usage inside of ENV variable references based on whether it is
quoted or not.
2014-02-21 16:39:12 -05:00
..
CMP0004 Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
CMP0019 Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
CMP0022 OS X: Add CMP0042 to enable MACOSX_RPATH by default 2014-01-02 13:41:49 -05:00
CMP0026 Cygwin: Avoid legacy warnings in RunCMake.CMP0026 test 2013-10-19 06:47:12 -04:00
CMP0027 Handle genexes when evaluating INTERFACE_INCLUDE_DIRECTORIES errors. 2013-10-18 10:11:49 -04:00
CMP0028 CMP0028: Trigger on libraries from INTERFACE of dependencies. 2014-02-09 15:35:28 +01:00
CMP0037 CMP0037: Extend policy to reserved names and custom targets 2013-11-19 09:44:22 -05:00
CMP0038 Disallow link-to-self (#13947). 2013-11-07 11:06:39 +01:00
CMP0039 CMP0039: Add missing '.' to policy summary line 2013-11-12 11:54:14 -05:00
CMP0040 Add policy CMP0040 to disallow custom commands on missing targets 2013-11-21 09:24:08 -05:00
CMP0041 Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests 2014-01-28 17:07:56 -05:00
CMP0042 Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests 2014-01-28 17:07:56 -05:00
CMP0043 Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests 2014-01-28 17:07:56 -05:00
CMP0045 Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests 2014-01-28 17:07:56 -05:00
CMP0046 AddDependencies: new policy requires dependencies to exist 2014-01-12 12:58:04 +01:00
CMP0049 Add policy CMP0049 to avoid variable expansion in source lists 2014-02-12 11:17:38 -05:00
CMP0050 add_custom_command: Disallow use of SOURCE signatures. 2014-02-12 11:19:27 -05:00
CTest build_command: Return a "cmake --build" command-line 2013-11-15 14:38:18 -05:00
CheckModules Tests: Speed up RunCMake.CheckModules test 2014-02-06 11:12:50 -05:00
CommandLine cmake: Add '-E sleep' command 2014-01-21 13:50:49 -05:00
CompatibleInterface CompatibleInterface: Test debugging of not-set property. 2014-01-07 09:38:01 -05:00
CompilerChange Drop use of configure_file IMMEDIATE option 2013-11-13 10:12:17 -05:00
CompilerNotFound Require CMAKE_<LANG>_COMPILER to be found as a full path 2013-10-28 08:36:14 -04:00
Configure Allow projects to specify extra inputs to CMake 2014-01-21 14:14:49 -05:00
DisallowedCommands Cygwin: Avoid legacy warnings in RunCMake.DisallowedCommands test 2013-10-25 15:07:35 -04:00
ExportWithoutLanguage export(): Process the export() command at generate time. 2013-10-11 12:46:10 +02:00
ExternalData ExternalData: Allow local stores without any URL templates 2013-11-13 10:03:36 -05:00
FPHSA Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
File_Generate Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
GeneratorExpression Genex: Use case-sensitive comparison for COMPILER_ID. 2014-01-08 16:41:34 +01:00
GeneratorToolset Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
IncompatibleQt Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
Languages Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
ObjectLibrary Merge topic 'object-library-missing-source' 2013-11-02 10:54:15 -04:00
ObsoleteQtMacros Qt4Macros: Port to use message(DEPRECATION) 2013-10-08 18:23:42 +02:00
PositionIndependentCode cmTarget: Report origin of COMPATIBLE_INTERFACE properties. 2013-12-08 07:03:29 +01:00
SolutionGlobalSections Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
Syntax tests: Add variable expansion tests 2014-02-21 16:39:12 -05:00
TargetPolicies Help: Ensure that target-policies are added to the documentation. 2014-01-07 16:05:15 +01:00
TargetPropertyGeneratorExpressions Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
VisibilityPreset Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
add_dependencies Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
alias_targets Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
build_command Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548) 2013-11-18 08:26:23 -05:00
cmake_minimum_required Drop compatibility with CMake < 2.4 2013-10-23 08:54:31 -04:00
export export: Implement EXPORT subcommand (#9822) 2013-12-24 13:02:49 +01:00
find_package Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
get_filename_component Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
if Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
include Don't allow include() of export(EXPORT) file at configure time. 2014-01-06 17:25:11 +01:00
include_directories Export: Process relative includes after genex evaluation. 2013-11-26 13:01:29 +01:00
include_external_msproject Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
install InstallRules: added new variable to disable generation of install rules 2014-01-08 16:28:14 +01:00
interface_library add_library: Issue better diagnostic for INTERFACE GLOBAL signature. 2014-02-07 15:49:15 +01:00
list Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
message message: Add a DEPRECATION mode 2013-10-08 18:11:22 +02:00
no_install_prefix Allow disabling adding the install prefix to the prefix search path. 2013-10-31 16:40:24 +01:00
project project: Manage VERSION variables 2014-01-29 09:45:18 -05:00
set set: Add unit tests for set/unset PARENT_SCOPE 2013-11-13 10:18:38 -05:00
string string: Add CONCAT sub-command 2013-10-21 12:54:20 -04:00
target_link_libraries Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
try_compile Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
variable_watch Cygwin: Avoid legacy warnings in RunCMake.* tests 2013-08-13 09:50:15 -04:00
CMakeLists.txt add_custom_command: Disallow use of SOURCE signatures. 2014-02-12 11:19:27 -05:00
README.rst Tests/RunCMake: Add function to run a specified command-line 2014-01-20 13:46:51 -05:00
RunCMake.cmake Tests/RunCMake: Add function to run a specified command-line 2014-01-20 13:46:51 -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.

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