summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2018-12-10 10:10:14 +0100
committerBrad King <brad.king@kitware.com>2019-01-16 10:34:08 -0500
commit2bedd5fb7c02987ad209f96889e2578a16806e01 (patch)
tree0e7dc8da87a7dc0a7197a451d29a4589f7bce111 /Source
parentc59eae7ebc5423c2b06befd762f8639b0f23b7a0 (diff)
downloadcmake-2bedd5fb7c02987ad209f96889e2578a16806e01.tar.gz
ctest_submit: Remove submit method from log output
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx97
1 files changed, 33 insertions, 64 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 30424802b1..7b510598bc 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -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()