diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 33 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.h | 28 |
2 files changed, 40 insertions, 21 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index e31d982..afc3e67 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -12,6 +12,29 @@ class cmExecutionStatus; +cmCTestSubmitCommand::cmCTestSubmitCommand() +{ + this->PartsMentioned = false; + this->FilesMentioned = false; + this->InternalTest = false; + this->RetryCount = ""; + this->RetryDelay = ""; + this->CDashUpload = false; + this->Arguments[cts_BUILD_ID] = "BUILD_ID"; + this->Last = cts_LAST; +} + +/** + * This is a virtual constructor for the command. + */ +cmCommand* cmCTestSubmitCommand::Clone() +{ + cmCTestSubmitCommand* ni = new cmCTestSubmitCommand; + ni->CTest = this->CTest; + ni->CTestScriptHandler = this->CTestScriptHandler; + return ni; +} + cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() { const char* submitURL = !this->SubmitURL.empty() @@ -111,7 +134,15 @@ 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 ret = this->cmCTestHandlerCommand::InitialPass(args, status); + + if (this->Values[cts_BUILD_ID] && *this->Values[cts_BUILD_ID]) { + this->Makefile->AddDefinition(this->Values[cts_BUILD_ID], + this->CTest->GetBuildID().c_str()); + } + + return ret; } bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 4b1bb26..1e27046 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -25,26 +25,8 @@ class cmExecutionStatus; class cmCTestSubmitCommand : public cmCTestHandlerCommand { public: - cmCTestSubmitCommand() - { - this->PartsMentioned = false; - this->FilesMentioned = false; - this->InternalTest = false; - this->RetryCount = ""; - this->RetryDelay = ""; - this->CDashUpload = false; - } - - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() override - { - cmCTestSubmitCommand* ni = new cmCTestSubmitCommand; - ni->CTest = this->CTest; - ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; - } + cmCTestSubmitCommand(); + cmCommand* Clone() override; bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) override; @@ -75,6 +57,12 @@ protected: ArgumentDoingLast2 }; + enum + { + cts_BUILD_ID = ct_LAST, + cts_LAST + }; + bool PartsMentioned; std::set<cmCTest::Part> Parts; bool FilesMentioned; |