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/CTest | |
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/CTest')
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.cxx | 28 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.h | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.cxx | 32 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.h | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 6 |
5 files changed, 64 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 4c39842..563c7b6 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -54,9 +54,37 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value) } //---------------------------------------------------------------------- +void cmCTestGenericHandler::SetPersistentOption(const char* op, const char* value) +{ + if ( !op ) + { + return; + } + if ( !value ) + { + cmCTestGenericHandler::t_StringToString::iterator remit + = this->PersistentOptions.find(op); + if ( remit != this->PersistentOptions.end() ) + { + this->PersistentOptions.erase(remit); + } + return; + } + + this->PersistentOptions[op] = value; +} + +//---------------------------------------------------------------------- void cmCTestGenericHandler::Initialize() { this->Options.clear(); + t_StringToString::iterator it; + for ( it = this->PersistentOptions.begin(); + it != this->PersistentOptions.end(); + ++ it ) + { + this->Options[it->first.c_str()] = it->second.c_str(); + } } //---------------------------------------------------------------------- diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 9efa113..2b84ded 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -75,6 +75,8 @@ public: typedef std::map<cmStdString,cmStdString> t_StringToString; + + void SetPersistentOption(const char* op, const char* value); void SetOption(const char* op, const char* value); const char* GetOption(const char* op); @@ -93,6 +95,7 @@ protected: bool HandlerVerbose; cmCTest *CTest; t_StringToString Options; + t_StringToString PersistentOptions; cmCTestCommand* Command; int SubmitIndex; diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 515cf75..aa77c75 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -29,22 +29,32 @@ bool cmCTestStartCommand::InitialPass( return false; } - const char* smodel = args[0].c_str(); + size_t cnt = 0; + const char* smodel = args[cnt].c_str(); const char* src_dir = 0; const char* bld_dir = 0; - if ( args.size() >= 2 ) + cnt++; + + this->CTest->SetSpecificTrack(0); + if ( cnt < args.size() -1 ) { - src_dir = args[1].c_str(); - if ( args.size() == 3 ) + if ( args[cnt] == "TRACK" ) { - bld_dir = args[2].c_str(); + cnt ++; + this->CTest->SetSpecificTrack(args[cnt].c_str()); + cnt ++; } } - if ( args.size() > 3 ) + + if ( cnt < args.size() ) { - this->SetError("called with incorrect number of arguments"); - return false; + src_dir = args[cnt].c_str(); + cnt ++; + if ( cnt < args.size() ) + { + bld_dir = args[cnt].c_str(); + } } if ( !src_dir ) { @@ -74,6 +84,12 @@ bool cmCTestStartCommand::InitialPass( << smodel << std::endl << " Source directory: " << src_dir << std::endl << " Build directory: " << bld_dir << std::endl); + const char* track = this->CTest->GetSpecificTrack(); + if ( track ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, + " Track: " << track << std::endl); + } this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", "OFF"); this->CTest->SetSuppressUpdatingCTestConfiguration(true); diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index f651bc8..3962d03 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -66,11 +66,12 @@ public: virtual const char* GetFullDocumentation() { return - " CTEST_START(Model [source [binary]])\n" + " CTEST_START(Model [TRACK <track>] [source [binary]])\n" "Starts the testing for a given model. The command should be called " "after the binary directory is initialized. If the 'source' and " "'binary' directory are not specified, it reads the " - "CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY."; + "CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is " + "specified, the submissions will go to the specified track."; } cmTypeMacro(cmCTestStartCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 8d5effa..b20388c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -874,6 +874,12 @@ int cmCTestSubmitHandler::ProcessHandler() cmCTestLog(this->CTest, HANDLER_OUTPUT, "Submit files (using " << this->CTest->GetCTestConfiguration("DropMethod") << ")" << std::endl); + const char* specificTrack = this->CTest->GetSpecificTrack(); + if ( specificTrack ) + { + cmCTestLog(this->CTest, HANDLER_OUTPUT, " Send to track: " + << specificTrack << std::endl); + } this->SetLogFile(&ofs); if ( this->CTest->GetCTestConfiguration("DropMethod") == "" || this->CTest->GetCTestConfiguration("DropMethod") == "ftp" ) |