diff options
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 122 |
1 files changed, 79 insertions, 43 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 07a994d..cc3514f 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -74,13 +75,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() std::vector<std::string> notesFiles; cmCTest::VectorOfStrings newNotesFiles; cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles); - std::vector<std::string>::iterator it; - for ( it = notesFiles.begin(); - it != notesFiles.end(); - ++ it ) - { - newNotesFiles.push_back(*it); - } + newNotesFiles.insert(newNotesFiles.end(), + notesFiles.begin(), notesFiles.end()); this->CTest->GenerateNotesFile(newNotesFiles); } @@ -91,13 +87,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() std::vector<std::string> extraFiles; cmCTest::VectorOfStrings newExtraFiles; cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles); - std::vector<std::string>::iterator it; - for ( it = extraFiles.begin(); - it != extraFiles.end(); - ++ it ) - { - newExtraFiles.push_back(*it); - } + newExtraFiles.insert(newExtraFiles.end(), + extraFiles.begin(), extraFiles.end()); if ( !this->CTest->SubmitExtraFiles(newExtraFiles)) { this->SetError("problem submitting extra files."); @@ -154,44 +145,75 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast<cmCTestSubmitHandler*>(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if (this->CDashUpload) + { + static_cast<cmCTestSubmitHandler*>(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast<cmCTestSubmitHandler*>(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } +//---------------------------------------------------------------------------- +bool cmCTestSubmitCommand::InitialPass(std::vector<std::string> const& args, + cmExecutionStatus& status) +{ + this->CDashUpload = !args.empty() && args[0] == "CDASH_UPLOAD"; + return this->cmCTestHandlerCommand::InitialPass(args, status); +} //---------------------------------------------------------------------------- bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) { - // Look for arguments specific to this command. - if(arg == "PARTS") + if (this->CDashUpload) { - this->ArgumentDoing = ArgumentDoingParts; - this->PartsMentioned = true; - return true; - } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } - if(arg == "FILES") - { - this->ArgumentDoing = ArgumentDoingFiles; - this->FilesMentioned = true; - return true; + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } } - - if(arg == "RETRY_COUNT") + else { - this->ArgumentDoing = ArgumentDoingRetryCount; - return true; - } + // Look for arguments specific to this command. + if(arg == "PARTS") + { + this->ArgumentDoing = ArgumentDoingParts; + this->PartsMentioned = true; + return true; + } - if(arg == "RETRY_DELAY") - { - this->ArgumentDoing = ArgumentDoingRetryDelay; - return true; - } + if(arg == "FILES") + { + this->ArgumentDoing = ArgumentDoingFiles; + this->FilesMentioned = true; + return true; + } - if(arg == "INTERNAL_TEST_CHECKSUM") - { - this->InternalTest = true; - return true; + if(arg == "RETRY_COUNT") + { + this->ArgumentDoing = ArgumentDoingRetryCount; + return true; + } + + if(arg == "RETRY_DELAY") + { + this->ArgumentDoing = ArgumentDoingRetryDelay; + return true; + } + + if(arg == "INTERNAL_TEST_CHECKSUM") + { + this->InternalTest = true; + return true; + } } // Look for other arguments. @@ -212,7 +234,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "Part name \"" << arg << "\" is invalid."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; @@ -229,7 +251,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -250,6 +272,20 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->ArgumentDoing = ArgumentDoingNone; + this->CDashUploadFile = arg; + return true; + } + + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->ArgumentDoing = ArgumentDoingNone; + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } |