diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2017-01-04 17:54:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-01-20 16:37:27 (GMT) |
commit | 0ce7643a84eabfc1c1083d2f3ecccfae6d04836a (patch) | |
tree | 892f87bac8dbe7981fc0d0eb1b1b8044babf2fa1 /Source | |
parent | 5614a5cd1f7f8fe34f6b31c572476a2ddfd6d9ae (diff) | |
download | CMake-0ce7643a84eabfc1c1083d2f3ecccfae6d04836a.zip CMake-0ce7643a84eabfc1c1083d2f3ecccfae6d04836a.tar.gz CMake-0ce7643a84eabfc1c1083d2f3ecccfae6d04836a.tar.bz2 |
ctest_submit: improve handling of QUIET option
Teach the CDASH_UPLOAD signature of ctest_submit() to more thoroughly
respect the QUIET option.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestCurl.cxx | 24 | ||||
-rw-r--r-- | Source/CTest/cmCTestCurl.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 1 |
3 files changed, 18 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 0fb4239..ab1412d 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -19,6 +19,7 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest) // default is to verify https this->VerifyPeerOff = false; this->VerifyHostOff = false; + this->Quiet = false; this->TimeOutSeconds = 0; this->Curl = curl_easy_init(); } @@ -159,13 +160,14 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, if (!responseData.empty()) { response = std::string(responseData.begin(), responseData.end()); - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Curl response: [" - << response << "]\n"); + cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n", this->Quiet); } std::string curlDebug; if (!debugData.empty()) { curlDebug = std::string(debugData.begin(), debugData.end()); - cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + cmCTestOptionalLog(this->CTest, DEBUG, + "Curl debug: [" << curlDebug << "]\n", this->Quiet); } if (response.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" @@ -179,9 +181,10 @@ bool cmCTestCurl::HttpRequest(std::string const& url, std::string const& fields, std::string& response) { response = ""; - cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" - << "url: " << url << "\n" - << "fields " << fields << "\n"); + cmCTestOptionalLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n", + this->Quiet); if (!this->InitCurl()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); return false; @@ -204,13 +207,16 @@ bool cmCTestCurl::HttpRequest(std::string const& url, if (!responseData.empty()) { response = std::string(responseData.begin(), responseData.end()); - cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + cmCTestOptionalLog(this->CTest, DEBUG, + "Curl response: [" << response << "]\n", this->Quiet); } if (!debugData.empty()) { std::string curlDebug = std::string(debugData.begin(), debugData.end()); - cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + cmCTestOptionalLog(this->CTest, DEBUG, + "Curl debug: [" << curlDebug << "]\n", this->Quiet); } - cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + cmCTestOptionalLog(this->CTest, DEBUG, "Curl res: " << res << "\n", + this->Quiet); return (res == 0); } diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index 17fbcff..cdce393 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -25,6 +25,7 @@ public: void SetCurlOptions(std::vector<std::string> const& args); void SetUseHttp10On() { this->UseHttp10 = true; } void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s; } + void SetQuiet(bool b) { this->Quiet = b; } std::string Escape(std::string const& source); protected: @@ -40,6 +41,7 @@ private: bool VerifyHostOff; bool VerifyPeerOff; bool UseHttp10; + bool Quiet; int TimeOutSeconds; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 8ded15e..5e5119d 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1007,6 +1007,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, return -1; } cmCTestCurl curl(this->CTest); + curl.SetQuiet(this->Quiet); std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); std::vector<std::string> args; cmSystemTools::ExpandListArgument(curlopt, args); |