diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 4aff64bd8..689f6abf4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1944,35 +1944,33 @@ 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; } +//---------------------------------------------------------------------- +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 &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 7c71b00ea..68811f8d9 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 &args);