summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-10 13:29:30 (GMT)
committerBrad King <brad.king@kitware.com>2011-06-10 13:52:18 (GMT)
commita4ec24269b32a28104e1d5681e718024b28bb4e7 (patch)
treefd4b0c30093063aa38bb65e2921d43aee01353fc /Source/cmTestGenerator.cxx
parent77ddb6a0cd35996f1329d727a25de3460f6aa899 (diff)
downloadCMake-a4ec24269b32a28104e1d5681e718024b28bb4e7.zip
CMake-a4ec24269b32a28104e1d5681e718024b28bb4e7.tar.gz
CMake-a4ec24269b32a28104e1d5681e718024b28bb4e7.tar.bz2
CTest: Report tests not run due to unknown configuration
When add_test(NAME) is called without the CONFIGURATIONS argument then the test is intended to run in any configuration. In multi-config generators like the VS IDE and Xcode tests created by add_test(NAME) can only be run when testing a known configuration (otherwise there is no way to generate the test command line). If no test command line is known for a particular configuration, or if no configuration is given to ctest, report the test as not run instead of silently skipping it. Also fix CMake's own TestsWorkingDirectory test invocation to correct a previously silent failure exposed by this change.
Diffstat (limited to 'Source/cmTestGenerator.cxx')
-rw-r--r--Source/cmTestGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 39f8638..e0892b2 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -130,6 +130,22 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
}
//----------------------------------------------------------------------------
+void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os,
+ Indent const& indent)
+{
+ os << indent << "ADD_TEST(" << this->Test->GetName() << " NOT_AVAILABLE)\n";
+}
+
+//----------------------------------------------------------------------------
+bool cmTestGenerator::NeedsScriptNoConfig() const
+{
+ return (this->TestGenerated && // test generated for at least one config
+ this->ActionsPerConfig && // test is config-aware
+ this->Configurations.empty() && // test runs in all configs
+ !this->ConfigurationTypes->empty()); // config-dependent command
+}
+
+//----------------------------------------------------------------------------
void cmTestGenerator::GenerateOldStyle(std::ostream& fout,
Indent const& indent)
{