CMake/Tests/RunCMake
Brad King 7b04ad61cf Merge topic 'option_respects_existing_stack_variable'
f8a7cf85ad option: No CMP077 warnings when both cache and local variable exists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2203
2018-07-12 09:12:26 -04:00
..
add_custom_command VS: Generate a custom command only in the least dependent target 2018-04-23 13:31:28 +09:00
add_custom_target add_custom_{command,target}: Fix crash on empty expanded command 2018-05-14 11:54:27 -04:00
add_dependencies Add a getter for manually added target dependencies 2017-01-16 22:38:24 +01:00
add_executable Defer check for sources within a target until generation. 2017-10-24 08:14:47 -04:00
add_library Do not produce legacy _LIB_DEPENDS cache entries 2018-03-07 07:48:40 -05:00
add_link_options LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
add_subdirectory Xcode: Add targets marked as EXCLUDE_FROM_ALL to project (#16101) 2016-08-31 09:16:44 -04:00
alias_targets add_library: Restore error on alias of non-global imported target 2018-05-10 09:57:31 -04:00
Android Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
AndroidMK LINK_OPTIONS: Add new family of properties 2018-06-06 17:22:39 +02:00
AndroidTestUtilities AndroidTestUtilities: do not require ExternalData unconditionally 2017-02-04 08:16:24 -05:00
AutoExportDll Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
build_command CTest: Stop telling 'make' to ignore errors with -i 2015-05-12 09:06:49 -04:00
BuildDepends GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CacheNewline cmCacheManager: Test and document newline truncation behavior 2018-01-15 09:28:32 -05:00
CheckIPOSupported IPO: Consider support for each language separately 2017-06-14 10:36:57 -04:00
CheckModules CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES 2018-04-18 08:09:56 -04:00
ClangTidy cmake: Report if the <LANG>_CLANG_TIDY tool exits with non-zero 2016-11-18 09:43:22 -05:00
cmake_minimum_required cmake_minimum_required: Tolerate unknown future arguments 2018-03-26 11:31:08 -04:00
cmake_parse_arguments cmake_parse_arguments: Add additional unit tests 2016-09-28 15:20:42 -04:00
CMP0004
CMP0019 Add deprecation warnings for policies CMP0036 and below 2017-04-21 15:04:33 -04:00
CMP0022 Tests: Fix RunCMake.CMP0022 tll case for Debug configuration 2017-05-18 10:18:50 -04:00
CMP0026 Add deprecation warnings for policies CMP0036 and below 2017-04-21 15:04:33 -04:00
CMP0027
CMP0028 Add deprecation warnings for policies CMP0036 and below 2017-04-21 15:04:33 -04:00
CMP0037 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0038 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0039 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0040 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0041 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0042 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0043 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0045 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0046 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0049 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0050 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0051 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0053 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0054 Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
CMP0055 RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
CMP0057 if: Implement new IN_LIST operator 2015-04-30 10:21:19 -04:00
CMP0059 CMP0059: Fix typo in policy description 2016-05-02 15:16:07 -04:00
CMP0060 GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
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
CMP0068 Add policy CMP0068 separate install_name and RPATH settings on macOS 2017-02-14 14:28:07 -07:00
CMP0069 IPO: Consider support for each language separately 2017-06-14 10:36:57 -04:00
CommandLine Tests: Adopt wizard test in RunCMake.CommandLine 2018-06-22 13:59:14 -04:00
CommandLineTar Tests: Consolidate, refactor and extend -E tar tests 2015-04-10 08:32:32 -04:00
CompatibleInterface Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
CompileDefinitions CompileDefinitions: Add unit test for setting empty content. 2015-07-22 21:23:49 +02:00
CompileFeatures CompileFeatures: Makes tests work with meta-feature only 2017-05-29 13:51:45 -04:00
CompilerChange
CompilerLauncher Fortran: Add option to run the compiler through launcher tools 2017-11-21 14:44:01 -05:00
CompilerNotFound nmake/jom: Only warn about bad VS environment if compiler not found. 2015-08-06 17:32:43 +00:00
Configure Tolerate removed/replaced CMakeCache.txt with old CMakeFiles/ 2016-11-17 10:29:58 -05:00
configure_file Tests: Add more signature tests to RunCMake.configure_file test 2015-03-09 09:17:59 -04:00
continue Use string(APPEND) in Tests 2016-07-28 00:43:04 +02:00
CPack Testing: Add test for CPack External generator 2018-07-02 09:51:02 -04:00
CPackCommandLine CPack: Fix crash on invalid generator name 2018-04-10 15:00:37 -04:00
CPackConfig Introduction of CPACK_VERBATIM_VARIABLES variable 2015-09-20 23:39:03 +02:00
CPackInstallProperties Tests: Use full output paths in file(GENERATE) calls 2017-06-08 13:31:33 -04:00
CPackSymlinks Tests: Add case for CPack source package with symlinks 2015-04-06 08:52:54 -04:00
Cppcheck Clean up iwyu code to not be one big if statement. 2017-09-13 17:44:49 -04:00
Cpplint Update cpplint support to return 0 and mark warnings for CDash. 2017-12-01 16:23:45 -05:00
CrosscompilingEmulator Tests: Check that CROSSCOMPILING_EMULATOR is not used on imported targets 2016-10-28 15:08:08 -04:00
CSharpCustomCommand Vs: fix CSharp custom command by introducing inline MSBuild <Targets>s 2017-06-22 21:40:48 +02:00
CSharpReferenceImport Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
CTest Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF" 2018-03-26 07:44:22 -04:00
ctest_build ctest_configure: Propagate CTEST_USE_LAUNCHERS from caller to project 2016-10-17 11:15:36 -04:00
ctest_cmake_error CTest: Add CAPTURE_CMAKE_ERROR val to ctest_* commands 2016-09-20 13:14:20 -04: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_disabled_test cmCTestTestHandler: indicate why a test did not run 2017-04-24 15:42:40 -04:00
ctest_fixtures CTest: Check failed fixture dependencies before test command and args 2017-11-29 07:27:20 +11:00
ctest_labels_for_subprojects CTest: Weight reported test times by PROCESSORS in summaries 2017-09-08 10:03:01 -04:00
ctest_memcheck ctest_memcheck: Fix sanitizers when MemoryCheckSanitizerOptions is empty 2017-01-23 10:50:38 -05:00
ctest_skipped_test cmCTestTestHandler: indicate why a test did not run 2017-04-24 15:42:40 -04:00
ctest_start ctest_start: read model from TAG file 2018-05-09 08:22:55 -04:00
ctest_submit ctest_submit: show headers as debug info 2018-06-27 15:08:14 -04:00
ctest_test Tests: Disable parallel test execution while running ctest_test 2015-10-27 21:44:04 +01:00
ctest_upload ctest_upload: Add QUIET option 2015-02-23 10:02:00 -05:00
CTestCommandLine CTest: Add options to control test process affinity to CPUs 2018-03-05 09:21:32 -05:00
CTestTimeoutAfterMatch CTest: Optionally use a secondary test timeout after matching output 2016-03-22 11:17:55 -04:00
DisallowedCommands Add deprecation warnings for policies CMP0036 and below 2017-04-21 15:04:33 -04:00
execute_process execute_process: Allow UTF-8 as a synonym for the UTF8 keyword 2017-12-27 21:56:00 +11:00
export Export: allow exporting of additional properties 2018-03-16 09:00:56 -04:00
ExportWithoutLanguage Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
ExternalData ExternalData: Add option to recursively match under directories 2015-03-27 14:44:54 -04:00
ExternalProject ExternalProject: Fix cache generation when args end with "-NOTFOUND" 2018-06-04 11:37:52 -04:00
FeatureSummary FeatureSummary: Add FeatureSummary_<TYPE>_DESCRIPTION global properties 2017-02-06 14:44:24 -05:00
FetchContent FetchContent: Add tests 2017-10-17 08:10:19 +11:00
file file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions 2018-06-22 09:39:05 -04:00
File_Generate GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
find_dependency Improve find_dependency argument handling 2017-05-22 13:32:43 -04:00
find_file Drop find_(library|file|path) prefixes from PATH on non-Windows 2016-05-09 12:58:08 -04:00
find_library find_library: Skip 'lib => lib<arch>' searches if one symlinks the other 2017-02-28 14:56:54 -05:00
find_package find_package: Improve CMP0074 warning messages 2018-03-21 07:51:20 -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 find_program: Consider CWD only for paths with separator 2018-06-14 14:28:03 -04:00
FindBoost FindBoost: Improve messages when a Boost CMake package is found 2017-09-29 10:10:01 -04:00
FindGTK2 FindGTK2: Add unit test to check variables when run twice 2017-01-25 10:20:35 +01:00
FindLua FindLua: Add tests for this module 2018-05-24 11:19:40 -04:00
FindMatlab FindMatlab: Matlab Runtime Compiler support 2018-04-23 10:30:49 -04:00
FindOpenGL FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL 2017-11-17 07:17:28 -05:00
FindPkgConfig FindPkgConfig: export the list of found libraries also as variable 2018-05-11 19:35:53 +02:00
foreach Tests: Add test for bad foreach inside a function 2017-11-16 11:10:05 -05:00
FPHSA FPHSA: fix typo in comment 2017-09-14 08:21:38 -04:00
Framework Tests: Fix RunCMake.Framework ios arch for Xcode 9 2017-10-03 09:09:08 -04:00
GenerateExportHeader Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
GeneratorExpression Genex: Allow COMPILE_LANGUAGE to name a language that is not loaded 2018-05-03 08:34:39 -04:00
GeneratorInstance VS: Select and save a VS 2017 instance persistently 2017-10-19 10:20:12 -04:00
GeneratorPlatform VS15: Add Visual Studio 15 generator 2016-09-07 15:49:08 -04:00
GeneratorToolset VS: Add option to select the version of the toolset used by VS 2017 2018-05-29 10:12:59 -04:00
get_filename_component get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semantics 2017-09-13 10:47:04 -04:00
get_property Tests management: add TESTS directory property 2018-02-08 19:16:28 +01:00
GetPrerequisites GetPrerequisites: Restore behavior on missing binary of not clearing list 2017-09-26 07:31:33 -04:00
GNUInstallDirs Tests: Fix RunCMake.GNUInstallDirs on BSD platforms 2017-06-02 16:26:30 -04:00
GoogleTest Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
if cmIfCommand: Reject duplicate else() and misplaced elseif() 2017-03-22 08:42:35 -04:00
IfacePaths Add deprecation warnings for policies CMP0054 and below 2017-11-01 11:46:53 -04:00
include Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
include_directories include_directories: Fix regression in BEFORE option (#15693) 2015-08-21 15:21:37 -04:00
include_external_msproject include_external_msproject: Honor MAP_IMPORTED_CONFIG_<CONFIG> 2017-04-05 13:44:03 -04:00
include_guard include_guard: add tests for the feature 2017-06-22 11:13:26 +03:00
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
install install: Allow installing targets created in another directory 2018-06-18 13:18:54 -04:00
interface_library CUDA: Add cu as default source file extension 2018-01-08 16:16:52 -05:00
Languages Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
LinkStatic Tests: Move LINK_SEARCH_{START,END}_STATIC case to dedicated test 2015-09-02 16:11:29 -04:00
LinkWhatYouUse Add options to run ldd -u -r as a "link-what-you-use" tool 2016-06-17 10:56:40 -04:00
list list: Allow inserting at the end of a list 2018-07-05 13:53:49 -04:00
Make include_regular_expression: Fix propagation to subdirectories 2018-01-24 08:20:19 -05:00
math math: Add options to calculate and format output as hexadecimal 2018-07-03 09:55:58 -04:00
message Fix trivial typos in text 2017-11-03 10:25:05 -04:00
MultiLint cmcmd: Restore support for running multiple lint tools 2017-10-27 09:26:50 -04:00
Ninja Ninja: Avoid empty phony edges for target ordering 2018-04-26 08:40:57 -04:00
no_install_prefix RunCMake: Remove unneeded files. 2015-02-09 19:15:04 +01:00
ObjectLibrary Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
ObsoleteQtMacros Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
option option: No CMP077 warnings when both cache and local variable exists 2018-07-10 13:56:15 -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
project project: Add HOMEPAGE_URL named parameter 2018-03-17 08:25:48 +11:00
return return: Add test for returning inside a foreach loop 2014-11-25 14:37:39 -05:00
RuntimePath GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
separate_arguments separgs: Add a NATIVE_COMMAND mode 2017-04-26 20:34:06 +02:00
set Merge branch 'parent-scope-tests' into variable-pull-failure 2014-10-24 13:34:30 -04:00
set_property LINK_OPTIONS: Add new family of properties 2018-06-06 17:22:39 +02:00
SourceProperties sourceFile properties: add property INCLUDE_DIRECTORIES 2018-01-24 15:10:10 +01:00
string string: Add JOIN subcommand 2018-02-16 10:04:47 -05:00
Swift Swift: Remove positive Swift language tests 2015-09-06 18:14:35 +02:00
Syntax ListFileLexer: Do not match null bytes in input 2018-06-26 11:54:34 -04:00
target_compile_features Teach target_* commands to set INTERFACE properties of IMPORTED targets 2017-10-26 09:11:04 -04:00
target_link_libraries Revert "target_link_libraries: Allow use with targets in other directories" 2018-07-03 09:39:28 -04:00
target_link_options LINK_OPTIONS: Add support of "LINKER:" prefix 2018-06-06 17:22:41 +02:00
TargetObjects Tests: Use full output paths in file(GENERATE) calls 2017-06-08 13:31:33 -04:00
TargetPolicies target_sources: Interpret relative paths as relative to the calling directory 2018-06-18 21:01:57 +02:00
TargetPropertyGeneratorExpressions Tests: Speed up RunCMake.TargetPropertyGeneratorExpressions 2018-01-25 12:08:13 -05:00
TargetSources target_sources: Interpret relative paths as relative to the calling directory 2018-06-18 21:01:57 +02:00
test_include_dirs GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
ToolchainFile Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files 2016-07-14 15:47:32 -04:00
try_compile Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
try_run Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
variable_watch variable_watch: trigger on variables set via PARENT_SCOPE 2018-04-11 15:02:07 -04:00
VisibilityPreset CMP0063: Split unit test by target type. 2015-10-20 23:58:48 +02:00
VS10Project VS10Project: Expand VS_DEBUGGER_* capabilities 2018-06-17 17:55:27 +10:00
VSSolution VS: Add SolutionGuid to generated .sln files 2017-07-11 10:41:28 -04:00
while Make error message of standalone endwhile command consistent 2016-11-29 13:53:29 -05:00
WorkingDirectory cmWorkingDirectory: Check success of current dir changes 2018-03-08 20:07:14 +11:00
WriteCompilerDetectionHeader WCDH: introduce BARE_FEATURES 2018-04-03 20:56:28 +02:00
XcodeProject Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
CMakeLists.txt Merge topic 'option-normal-variable' 2018-07-09 10:25:33 -04:00
exit_code.c execute_process: Add option to get results of every child 2017-06-10 08:03:06 -04:00
pseudo_cppcheck.c Revise C++ coding style using clang-format-6.0 2018-06-01 09:53:42 -04:00
pseudo_cpplint.c Add properties to run the cpplint style checker with the compiler 2017-01-23 14:47:13 -05:00
pseudo_emulator_custom_command.c Fix custom command target substitution with CROSSCOMPILING_EMULATOR 2016-10-28 15:08:03 -04:00
pseudo_emulator.c Revise C++ coding style using clang-format 2016-05-16 16:05:19 -04:00
pseudo_iwyu.c cmake: Comment why we ignore the include-what-you-use return code 2016-11-18 09:43:19 -05:00
pseudo_tidy.c cmake: Report if the <LANG>_CLANG_TIDY tool exits with non-zero 2016-11-18 09:43:22 -05:00
README.rst Tests: Update RunCMake/README.rst to clarify meaning of -result.txt 2017-09-14 14:15:26 -04:00
RunCMake.cmake Tests: Teach RunCMake to ignore Xcode missing file type warnings 2018-06-19 10:56:50 -04:00
RunCTest.cmake Update tests that expect uncompressed output 2016-11-08 15:58:29 -05:00

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