diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-04-28 15:59:31 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-04-28 15:59:31 (GMT) |
commit | 2d81046ae20d1638927e89f5e0b78daca1e102f3 (patch) | |
tree | ad74b7db193b4a5639183b6b0a4dbb6f931ddc1e /Source/cmCTest.cxx | |
parent | 185c282bd33e426751277c10078a14e9bcc08b85 (diff) | |
download | CMake-2d81046ae20d1638927e89f5e0b78daca1e102f3.zip CMake-2d81046ae20d1638927e89f5e0b78daca1e102f3.tar.gz CMake-2d81046ae20d1638927e89f5e0b78daca1e102f3.tar.bz2 |
ENH: Add support for special tracks, fix options of handlers so that the -R, -U, and so on work in the new style scripting
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 839cced..cfba26b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -784,7 +784,7 @@ int cmCTest::ProcessTests() if ( this->Tests[UPDATE_TEST] || this->Tests[ALL_TEST] ) { cmCTestGenericHandler* uphandler = this->GetHandler("update"); - uphandler->SetOption("SourceDirectory", + uphandler->SetPersistentOption("SourceDirectory", this->GetCTestConfiguration("SourceDirectory").c_str()); update_count = uphandler->ProcessHandler(); if ( update_count < 0 ) @@ -887,6 +887,10 @@ int cmCTest::ProcessTests() //---------------------------------------------------------------------- std::string cmCTest::GetTestModelString() { + if ( !this->SpecificTrack.empty() ) + { + return this->SpecificTrack; + } switch ( this->TestModel ) { case cmCTest::NIGHTLY: @@ -1337,6 +1341,11 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) this->Debug = true; this->ShowLineNumbers = true; } + if(this->CheckArgument(arg, "--track") && i < args.size() - 1) + { + i++; + this->SpecificTrack = args[i]; + } if(this->CheckArgument(arg, "--show-line-numbers")) { this->ShowLineNumbers = true; @@ -1690,22 +1699,22 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("TestsToRunInformation", + this->GetHandler("test")->SetPersistentOption("TestsToRunInformation", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("TestsToRunInformation", + this->GetHandler("memcheck")->SetPersistentOption("TestsToRunInformation", args[i].c_str()); } if(this->CheckArgument(arg, "-U", "--union")) { - this->GetHandler("test")->SetOption("UseUnion", "true"); - this->GetHandler("memcheck")->SetOption("UseUnion", "true"); + this->GetHandler("test")->SetPersistentOption("UseUnion", "true"); + this->GetHandler("memcheck")->SetPersistentOption("UseUnion", "true"); } if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("IncludeRegularExpression", + this->GetHandler("test")->SetPersistentOption("IncludeRegularExpression", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("IncludeRegularExpression", + this->GetHandler("memcheck")->SetPersistentOption("IncludeRegularExpression", args[i].c_str()); } @@ -1713,9 +1722,9 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) i < args.size() - 1) { i++; - this->GetHandler("test")->SetOption("ExcludeRegularExpression", + this->GetHandler("test")->SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); - this->GetHandler("memcheck")->SetOption("ExcludeRegularExpression", + this->GetHandler("memcheck")->SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); } @@ -1930,6 +1939,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf, { cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " << fname.c_str() << std::endl); + bool erroroc = cmSystemTools::GetErrorOccuredFlag(); + cmSystemTools::ResetErrorOccuredFlag(); + if ( !mf->ReadListFile(0, fname.c_str()) || cmSystemTools::GetErrorOccuredFlag() ) { @@ -1938,6 +1950,10 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf, << fname.c_str() << std::endl); } found = true; + if ( erroroc ) + { + cmSystemTools::SetErrorOccured(); + } } if ( !fast ) @@ -2151,6 +2167,27 @@ bool cmCTest::GetProduceXML() } //---------------------------------------------------------------------- +const char* cmCTest::GetSpecificTrack() +{ + if ( this->SpecificTrack.empty() ) + { + return 0; + } + return this->SpecificTrack.c_str(); +} + +//---------------------------------------------------------------------- +void cmCTest::SetSpecificTrack(const char* track) +{ + if ( !track ) + { + this->SpecificTrack = ""; + return; + } + this->SpecificTrack = track; +} + +//---------------------------------------------------------------------- void cmCTest::AddSubmitFile(const char* name) { this->SubmitFiles.insert(name); |