diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2019-03-19 11:09:19 -0400 |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2019-03-22 09:37:08 -0400 |
commit | ba7e44eb7a319d15c7ac18bdf6d15487311a85a2 (patch) | |
tree | 00163a98115c833700f55973cc6755e350076df5 /Source/CTest/cmCTestSubmitCommand.cxx | |
parent | 89abbdd8c8db5bf587373f2a00f6a816eddd8496 (diff) | |
download | cmake-ba7e44eb7a319d15c7ac18bdf6d15487311a85a2.tar.gz |
ctest_submit: Add option BUILD_ID
Fixes: #18968
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index e31d982a2f..afc3e67d9b 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) |