diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2017-07-07 15:20:08 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2017-07-12 17:28:21 (GMT) |
commit | ed5bde30f70a7da8cc95e600195b58e0d936e38d (patch) | |
tree | e26fc9248bfb7e8f39ce13ee61d0cd21dc8e77c8 | |
parent | e40e8f5c4216ac1e176342887d1af95965528344 (diff) | |
download | CMake-ed5bde30f70a7da8cc95e600195b58e0d936e38d.zip CMake-ed5bde30f70a7da8cc95e600195b58e0d936e38d.tar.gz CMake-ed5bde30f70a7da8cc95e600195b58e0d936e38d.tar.bz2 |
Add TEST_INCLUDE_FILES
Add new directory property TEST_INCLUDE_FILES. This supersedes
TEST_INCLUDE_FILE, though the latter is of course retained for
compatibility.
Basically, this is a list rather than a single file. This allows the
feature to be used by generic utilities without conflicting with local
use.
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 3 | ||||
-rw-r--r-- | Help/prop_dir/TEST_INCLUDE_FILE.rst | 4 | ||||
-rw-r--r-- | Help/prop_dir/TEST_INCLUDE_FILES.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/test_include_files.rst | 7 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 |
5 files changed, 30 insertions, 2 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 94ab70c..be7f772 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -83,7 +83,7 @@ Properties on Directories /prop_dir/RULE_LAUNCH_LINK /prop_dir/SOURCE_DIR /prop_dir/SUBDIRECTORIES - /prop_dir/TEST_INCLUDE_FILE + /prop_dir/TEST_INCLUDE_FILES /prop_dir/VARIABLES /prop_dir/VS_GLOBAL_SECTION_POST_section /prop_dir/VS_GLOBAL_SECTION_PRE_section @@ -435,6 +435,7 @@ Deprecated Properties on Directories :maxdepth: 1 /prop_dir/COMPILE_DEFINITIONS_CONFIG + /prop_dir/TEST_INCLUDE_FILE Deprecated Properties on Targets diff --git a/Help/prop_dir/TEST_INCLUDE_FILE.rst b/Help/prop_dir/TEST_INCLUDE_FILE.rst index e477951..31b2382 100644 --- a/Help/prop_dir/TEST_INCLUDE_FILE.rst +++ b/Help/prop_dir/TEST_INCLUDE_FILE.rst @@ -1,7 +1,9 @@ TEST_INCLUDE_FILE ----------------- +Deprecated. Use :prop_dir:`TEST_INCLUDE_FILES` instead. + A cmake file that will be included when ctest is run. -If you specify TEST_INCLUDE_FILE, that file will be included and +If you specify ``TEST_INCLUDE_FILE``, that file will be included and processed when ctest is run on the directory. diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst new file mode 100644 index 0000000..c3e4602 --- /dev/null +++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst @@ -0,0 +1,7 @@ +TEST_INCLUDE_FILES +------------------ + +A list of cmake files that will be included when ctest is run. + +If you specify ``TEST_INCLUDE_FILES``, those files will be included and +processed when ctest is run on the directory. diff --git a/Help/release/dev/test_include_files.rst b/Help/release/dev/test_include_files.rst new file mode 100644 index 0000000..b75dd0d --- /dev/null +++ b/Help/release/dev/test_include_files.rst @@ -0,0 +1,7 @@ +test_include_files +------------------ + +* A :prop_dir:`TEST_INCLUDE_FILES` directory property was added to + list any number of files to be included when running tests with + :manual:`ctest(1)`. This generalizes the :prop_dir:`TEST_INCLUDE_FILE` + property. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 8e00303..96d8707 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -259,6 +259,17 @@ void cmLocalGenerator::GenerateTestFiles() fout << "include(\"" << testIncludeFile << "\")" << std::endl; } + const char* testIncludeFiles = + this->Makefile->GetProperty("TEST_INCLUDE_FILES"); + if (testIncludeFiles) { + std::vector<std::string> includesList; + cmSystemTools::ExpandListArgument(testIncludeFiles, includesList); + for (std::vector<std::string>::const_iterator i = includesList.begin(); + i != includesList.end(); ++i) { + fout << "include(\"" << *i << "\")" << std::endl; + } + } + // Ask each test generator to write its code. std::vector<cmTestGenerator*> const& testers = this->Makefile->GetTestGenerators(); |