diff options
author | David Cole <david.cole@kitware.com> | 2012-06-24 09:33:32 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2012-06-24 09:46:55 (GMT) |
commit | 24ba0fd078ca1db13cdbeb51e531b0fce53f3f3f (patch) | |
tree | 910a7aae614c8f3a596e14a5c7f7ce729dbcc1b0 /Source | |
parent | 03022877399735b930ae44f1fd2d19d64e4a8a2f (diff) | |
download | CMake-24ba0fd078ca1db13cdbeb51e531b0fce53f3f3f.zip CMake-24ba0fd078ca1db13cdbeb51e531b0fce53f3f3f.tar.gz CMake-24ba0fd078ca1db13cdbeb51e531b0fce53f3f3f.tar.bz2 |
CTest: Refactor error output into ErrorMessageUnknownDashDValue
No behavior change. Prep work for defining script variables by
extending -D command line handling to recognize var:type=value syntax.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCTest.cxx | 47 | ||||
-rw-r--r-- | Source/cmCTest.h | 4 |
2 files changed, 27 insertions, 24 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 4aff64b..689f6ab 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1944,29 +1944,6 @@ bool cmCTest::AddTestsForDashboardType(std::string &targ) } else { - cmCTestLog(this, ERROR_MESSAGE, - "CTest -D called with incorrect option: " - << targ << std::endl); - cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl - << " " << "ctest" << " -D Continuous" << std::endl - << " " << "ctest" - << " -D Continuous(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Continuous(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Experimental" << std::endl - << " " << "ctest" - << " -D Experimental(Start|Update|Configure|Build)" - << std::endl - << " " << "ctest" - << " -D Experimental(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Nightly" << std::endl - << " " << "ctest" - << " -D Nightly(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl - << " " << "ctest" << " -D NightlyMemoryCheck" << std::endl); return false; } return true; @@ -1974,6 +1951,27 @@ bool cmCTest::AddTestsForDashboardType(std::string &targ) //---------------------------------------------------------------------- +void cmCTest::ErrorMessageUnknownDashDValue(std::string &val) +{ + cmCTestLog(this, ERROR_MESSAGE, + "CTest -D called with incorrect option: " << val << std::endl); + + cmCTestLog(this, ERROR_MESSAGE, + "Available options are:" << std::endl + << " ctest -D Continuous" << std::endl + << " ctest -D Continuous(Start|Update|Configure|Build)" << std::endl + << " ctest -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Experimental" << std::endl + << " ctest -D Experimental(Start|Update|Configure|Build)" << std::endl + << " ctest -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Nightly" << std::endl + << " ctest -D Nightly(Start|Update|Configure|Build)" << std::endl + << " ctest -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D NightlyMemoryCheck" << std::endl); +} + + +//---------------------------------------------------------------------- bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2) { @@ -2263,10 +2261,11 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) this->ProduceXML = true; i++; std::string targ = args[i]; - // AddTestsForDashboard parses the dashborad type and converts it + // AddTestsForDashboard parses the dashboard type and converts it // into the separate stages if (!this->AddTestsForDashboardType(targ)) { + this->ErrorMessageUnknownDashDValue(targ); performSomeTest = false; } } diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 7c71b00..68811f8 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -417,6 +417,7 @@ public: bool GetLabelSummary() { return this->LabelSummary;} std::string GetCostDataFile(); + private: std::string ConfigType; std::string ScheduleType; @@ -516,6 +517,9 @@ private: //! parse the option after -D and convert it into the appropriate steps bool AddTestsForDashboardType(std::string &targ); + //! read as "emit an error message for an unknown -D value" + void ErrorMessageUnknownDashDValue(std::string &val); + //! parse and process most common command line arguments void HandleCommandLineArguments(size_t &i, std::vector<std::string> &args); |