ctest_submit: Remove submit method from log output

This commit is contained in:
Regina Pfeifer
2018-12-10 10:10:14 +01:00
committed by Brad King
parent c59eae7ebc
commit 2bedd5fb7c
3 changed files with 37 additions and 70 deletions

View File

@@ -162,7 +162,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
/* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL);
std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(curlopt, args);
@@ -503,12 +502,8 @@ void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod,
url += "://";
if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
url += this->CTest->GetCTestConfiguration("DropSiteUser");
cmCTestOptionalLog(
this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSiteUser").c_str(), this->Quiet);
if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******", this->Quiet);
}
url += "@";
}
@@ -545,7 +540,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
fields = url.substr(pos + 1);
url = url.substr(0, pos);
}
if (!(dropMethod == "http" || dropMethod == "https")) {
if (!cmHasLiteralPrefix(url, "http://") &&
!cmHasLiteralPrefix(url, "https://")) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Only http and https are supported for CDASH_UPLOAD\n");
return -1;
@@ -872,10 +868,7 @@ int cmCTestSubmitHandler::ProcessHandler()
cnt++;
}
}
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"Submit files (using "
<< this->CTest->GetCTestConfiguration("DropMethod")
<< ")" << std::endl,
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files\n",
this->Quiet);
const char* specificTrack = this->CTest->GetSpecificTrack();
if (specificTrack) {
@@ -891,66 +884,42 @@ int cmCTestSubmitHandler::ProcessHandler()
dropMethod = "http";
}
if (dropMethod == "http" || dropMethod == "https") {
std::string url = dropMethod;
url += "://";
ofs << "Using drop method: " << dropMethod << std::endl;
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Using HTTP submit method" << std::endl
<< " Drop site:" << url,
this->Quiet);
if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
url += this->CTest->GetCTestConfiguration("DropSiteUser");
cmCTestOptionalLog(
this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSiteUser").c_str(),
this->Quiet);
if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
this->Quiet);
}
url += "@";
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet);
std::string url = dropMethod;
url += "://";
if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
url += this->CTest->GetCTestConfiguration("DropSiteUser");
if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
}
url += this->CTest->GetCTestConfiguration("DropSite") +
this->CTest->GetCTestConfiguration("DropLocation");
url += "@";
}
url += this->CTest->GetCTestConfiguration("DropSite") +
this->CTest->GetCTestConfiguration("DropLocation");
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" SubmitURL: " << url << '\n', this->Quiet);
if (!this->SubmitUsingHTTP(buildDirectory + "/Testing/" +
this->CTest->GetCurrentTag(),
files, prefix, url)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Problems when submitting via HTTP\n");
ofs << " Problems when submitting via HTTP\n";
return -1;
}
if (this->HasErrors) {
cmCTestLog(this->CTest, HANDLER_OUTPUT,
" Errors occurred during submission.\n");
ofs << " Errors occurred during submission.\n";
} else {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSite")
<< this->CTest->GetCTestConfiguration("DropLocation")
" Submission successful"
<< (this->HasWarnings ? ", with warnings." : "")
<< std::endl,
this->Quiet);
if (!this->SubmitUsingHTTP(buildDirectory + "/Testing/" +
this->CTest->GetCurrentTag(),
files, prefix, url)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Problems when submitting via HTTP" << std::endl);
ofs << " Problems when submitting via HTTP" << std::endl;
return -1;
}
if (this->HasErrors) {
cmCTestLog(this->CTest, HANDLER_OUTPUT,
" Errors occurred during "
"submission."
<< std::endl);
ofs << " Errors occurred during submission. " << std::endl;
} else {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Submission successful"
<< (this->HasWarnings ? ", with warnings." : "")
<< std::endl,
this->Quiet);
ofs << " Submission successful"
<< (this->HasWarnings ? ", with warnings." : "") << std::endl;
}
return 0;
ofs << " Submission successful"
<< (this->HasWarnings ? ", with warnings." : "") << std::endl;
}
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Unknown submission method: \"" << dropMethod << "\""
<< std::endl);
return -1;
return 0;
}
std::string cmCTestSubmitHandler::GetSubmitResultsPrefix()

View File

@@ -1,3 +1,2 @@
Submit files \(using http\)
Using HTTP submit method
Drop site:http://
Submit files
SubmitURL: http://-no-site-

View File

@@ -1,3 +1,2 @@
Submit files \(using https\)
Using HTTP submit method
Drop site:https://
Submit files
SubmitURL: https://-no-site-