mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
CTestSubmit: Prefer concrete variables over map entries
This commit is contained in:
@@ -164,15 +164,16 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
|
||||
handler->SetHttpHeaders(this->HttpHeaders);
|
||||
}
|
||||
|
||||
handler->SetOption("RetryDelay", this->RetryDelay);
|
||||
handler->SetOption("RetryCount", this->RetryCount);
|
||||
handler->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF");
|
||||
handler->RetryDelay = this->RetryDelay;
|
||||
handler->RetryCount = this->RetryCount;
|
||||
handler->InternalTest = this->InternalTest;
|
||||
|
||||
handler->SetQuiet(this->Quiet);
|
||||
|
||||
if (this->CDashUpload) {
|
||||
handler->SetOption("CDashUploadFile", this->CDashUploadFile);
|
||||
handler->SetOption("CDashUploadType", this->CDashUploadType);
|
||||
handler->CDashUpload = true;
|
||||
handler->CDashUploadFile = this->CDashUploadFile;
|
||||
handler->CDashUploadType = this->CDashUploadType;
|
||||
}
|
||||
return handler;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
|
||||
|
||||
upload_as += "&MD5=";
|
||||
|
||||
if (this->GetOption("InternalTest").IsOn()) {
|
||||
if (this->InternalTest) {
|
||||
upload_as += "ffffffffffffffffffffffffffffffff";
|
||||
} else {
|
||||
cmCryptoHash hasher(cmCryptoHash::AlgoMD5);
|
||||
@@ -368,8 +368,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
|
||||
bool successful_submission = response_code == 200;
|
||||
|
||||
if (!successful_submission || this->HasErrors) {
|
||||
std::string retryDelay = *this->GetOption("RetryDelay");
|
||||
std::string retryCount = *this->GetOption("RetryCount");
|
||||
std::string retryDelay = this->RetryDelay;
|
||||
std::string retryCount = this->RetryCount;
|
||||
|
||||
auto delay = cmDuration(
|
||||
retryDelay.empty()
|
||||
@@ -528,11 +528,11 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
|
||||
fields = url.substr(pos + 1);
|
||||
url.erase(pos);
|
||||
}
|
||||
bool internalTest = this->GetOption("InternalTest").IsOn();
|
||||
bool internalTest = this->InternalTest;
|
||||
|
||||
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
|
||||
std::string retryDelayString = *this->GetOption("RetryDelay");
|
||||
std::string retryCountString = *this->GetOption("RetryCount");
|
||||
std::string retryDelayString = this->RetryDelay;
|
||||
std::string retryCountString = this->RetryCount;
|
||||
auto retryDelay = std::chrono::seconds(0);
|
||||
if (!retryDelayString.empty()) {
|
||||
unsigned long retryDelayValue = 0;
|
||||
@@ -721,10 +721,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
|
||||
|
||||
int cmCTestSubmitHandler::ProcessHandler()
|
||||
{
|
||||
cmValue cdashUploadFile = this->GetOption("CDashUploadFile");
|
||||
cmValue cdashUploadType = this->GetOption("CDashUploadType");
|
||||
if (cdashUploadFile && cdashUploadType) {
|
||||
return this->HandleCDashUploadFile(*cdashUploadFile, *cdashUploadType);
|
||||
if (this->CDashUpload) {
|
||||
return this->HandleCDashUploadFile(this->CDashUploadFile,
|
||||
this->CDashUploadType);
|
||||
}
|
||||
|
||||
const std::string& buildDirectory =
|
||||
|
||||
@@ -88,4 +88,14 @@ private:
|
||||
std::set<std::string> Files;
|
||||
std::vector<std::string> CommandLineHttpHeaders;
|
||||
std::vector<std::string> HttpHeaders;
|
||||
|
||||
bool CDashUpload = false;
|
||||
bool InternalTest = false;
|
||||
|
||||
std::string CDashUploadFile;
|
||||
std::string CDashUploadType;
|
||||
std::string RetryCount;
|
||||
std::string RetryDelay;
|
||||
|
||||
friend class cmCTestSubmitCommand;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user