diff options
author | Brad King <brad.king@kitware.com> | 2009-11-24 13:58:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-11-24 13:58:48 (GMT) |
commit | c2ba35787e4f710d7424c30c61efd1d386d0d619 (patch) | |
tree | 16e8166e4df7d7bb1ce847b1b4946037a5bec51d | |
parent | a03f801f7f8d6d244623ce373ea583b95443bb9a (diff) | |
download | CMake-c2ba35787e4f710d7424c30c61efd1d386d0d619.zip CMake-c2ba35787e4f710d7424c30c61efd1d386d0d619.tar.gz CMake-c2ba35787e4f710d7424c30c61efd1d386d0d619.tar.bz2 |
CTest: Simplify Initialize method signature
We make the cmCTest::Initialize method private since it is only called
from inside the class implementation. We also combine the two boolean
arguments into one since they both meant the same thing.
-rw-r--r-- | Source/cmCTest.cxx | 13 | ||||
-rw-r--r-- | Source/cmCTest.h | 11 |
2 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index fee94d1..e00c8da 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -311,8 +311,7 @@ cmCTest::Part cmCTest::GetPartFromName(const char* name) } //---------------------------------------------------------------------- -int cmCTest::Initialize(const char* binary_dir, bool new_tag, - bool verbose_tag) +int cmCTest::Initialize(const char* binary_dir, bool script) { cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl); if(!this->InteractiveDebugMode) @@ -416,7 +415,7 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, } tfin.close(); } - if (tag.size() == 0 || new_tag || this->Parts[PartStart]) + if (tag.size() == 0 || script || this->Parts[PartStart]) { cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString() << std::endl); @@ -441,7 +440,7 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, ofs << this->GetTestModelString() << std::endl; } ofs.close(); - if ( verbose_tag ) + if ( !script ) { cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - " << this->GetTestModelString() << std::endl); @@ -517,7 +516,7 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first) } } - if ( !this->Initialize(bld_dir.c_str(), true, false) ) + if ( !this->Initialize(bld_dir.c_str(), true) ) { if ( this->GetCTestConfiguration("NightlyStartTime").empty() && first) { @@ -2113,8 +2112,8 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) it->second->SetVerbose(this->Verbose); it->second->SetSubmitIndex(this->SubmitIndex); } - if ( !this->Initialize( - cmSystemTools::GetCurrentWorkingDirectory().c_str()) ) + std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); + if(!this->Initialize(cwd.c_str(), false)) { res = 12; cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 47023f1..652b1c4 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -93,8 +93,6 @@ public: /** * Initialize and finalize testing */ - int Initialize(const char* binary_dir, bool new_tag = false, - bool verbose_tag = true); bool InitializeFromCommand(cmCTestCommand* command, bool first = false); void Finalize(); @@ -446,6 +444,15 @@ private: void BlockTestErrorDiagnostics(); + /** + * Initialize a dashboard run in the given build tree. The "script" + * argument is true when running from a command-driven (ctest_start) + * dashboard script, and false when running from the CTest command + * line. Note that a declarative dashboard script does not actually + * call this method because it sets CTEST_COMMAND to drive a build + * through the ctest command line. + */ + int Initialize(const char* binary_dir, bool script); //! parse the option after -D and convert it into the appropriate steps bool AddTestsForDashboardType(std::string &targ); |