summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2015-02-16 21:02:14 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-23 15:01:58 (GMT)
commit1643b905e02473536d60ef4102d3154a6c8816d1 (patch)
tree197f97549c4459cf1d70421134cbf1fe4e697c66 /Source/CTest
parent12db113944860269b72093424b17ad2f86bccf2f (diff)
downloadCMake-1643b905e02473536d60ef4102d3154a6c8816d1.zip
CMake-1643b905e02473536d60ef4102d3154a6c8816d1.tar.gz
CMake-1643b905e02473536d60ef4102d3154a6c8816d1.tar.bz2
ctest_submit: Add QUIET option
Specifying this option prevents CTest from printing any non-error messages to the console for this call to ctest_submit().
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx1
-rw-r--r--Source/CTest/cmCTestGenericHandler.h3
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx16
-rw-r--r--Source/CTest/cmCTestHandlerCommand.h1
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx26
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx239
6 files changed, 160 insertions, 126 deletions
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 13c8ca5..81eb0a8 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -22,6 +22,7 @@ cmCTestGenericHandler::cmCTestGenericHandler()
this->CTest = 0;
this->SubmitIndex = 0;
this->AppendXML = false;
+ this->Quiet = false;
}
//----------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 2788cba..8567dd7 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -87,6 +87,8 @@ public:
int GetSubmitIndex() { return this->SubmitIndex; }
void SetAppendXML(bool b) { this->AppendXML = b; }
+ void SetQuiet(bool b) { this->Quiet = b; }
+ bool GetQuiet() { return this->Quiet; }
protected:
bool StartResultingXML(cmCTest::Part part,
@@ -94,6 +96,7 @@ protected:
bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
bool AppendXML;
+ bool Quiet;
cmSystemTools::OutputOption HandlerVerbose;
cmCTest *CTest;
t_StringToString Options;
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index b886777..3003e8a 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -29,6 +29,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand()
this->Arguments[ct_SUBMIT_INDEX] = "SUBMIT_INDEX";
this->Last = ct_LAST;
this->AppendXML = false;
+ this->Quiet = false;
}
bool cmCTestHandlerCommand
@@ -74,7 +75,7 @@ bool cmCTestHandlerCommand
{
this->CTest->SetCTestConfiguration("BuildDirectory",
cmSystemTools::CollapseFullPath(
- this->Values[ct_BUILD]).c_str());
+ this->Values[ct_BUILD]).c_str(), this->Quiet);
}
else
{
@@ -84,7 +85,7 @@ bool cmCTestHandlerCommand
{
this->
CTest->SetCTestConfiguration("BuildDirectory",
- cmSystemTools::CollapseFullPath(bdir).c_str());
+ cmSystemTools::CollapseFullPath(bdir).c_str(), this->Quiet);
}
else
{
@@ -98,13 +99,14 @@ bool cmCTestHandlerCommand
"Set source directory to: " << this->Values[ct_SOURCE] << std::endl);
this->CTest->SetCTestConfiguration("SourceDirectory",
cmSystemTools::CollapseFullPath(
- this->Values[ct_SOURCE]).c_str());
+ this->Values[ct_SOURCE]).c_str(), this->Quiet);
}
else
{
this->CTest->SetCTestConfiguration("SourceDirectory",
cmSystemTools::CollapseFullPath(
- this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
+ this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str(),
+ this->Quiet);
}
cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
@@ -160,6 +162,12 @@ bool cmCTestHandlerCommand::CheckArgumentKeyword(std::string const& arg)
this->AppendXML = true;
return true;
}
+ if(arg == "QUIET")
+ {
+ this->ArgumentDoing = ArgumentDoingNone;
+ this->Quiet = true;
+ return true;
+ }
// Check for a keyword in our argument/value table.
for(unsigned int k=0; k < this->Arguments.size(); ++k)
diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h
index 8ef2b80..87b2cd8 100644
--- a/Source/CTest/cmCTestHandlerCommand.h
+++ b/Source/CTest/cmCTestHandlerCommand.h
@@ -62,6 +62,7 @@ protected:
unsigned int ArgumentIndex;
bool AppendXML;
+ bool Quiet;
std::string ReturnVariable;
std::vector<const char*> Arguments;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index cc3514f..5a8090c 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -44,29 +44,33 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
// error: CDash requires CTEST_DROP_LOCATION definition
// in CTestConfig.cmake
}
- this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName);
- this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod);
- this->CTest->SetCTestConfiguration("DropSite", ctestDropSite);
- this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation);
+ this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("DropSite", ctestDropSite, this->Quiet);
+ this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation,
+ this->Quiet);
this->CTest->SetCTestConfiguration("IsCDash",
- ctestDropSiteCDash ? "TRUE" : "FALSE");
+ ctestDropSiteCDash ? "TRUE" : "FALSE", this->Quiet);
// Only propagate TriggerSite for non-CDash projects:
//
if ( !ctestDropSiteCDash )
{
- this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite);
+ this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite,
+ this->Quiet);
}
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
- "CurlOptions", "CTEST_CURL_OPTIONS");
+ "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
- "DropSiteUser", "CTEST_DROP_SITE_USER");
+ "DropSiteUser", "CTEST_DROP_SITE_USER", this->Quiet);
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
- "DropSitePassword", "CTEST_DROP_SITE_PASSWORD");
+ "DropSitePassword", "CTEST_DROP_SITE_PASSWORD", this->Quiet);
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
- "ScpCommand", "CTEST_SCP_COMMAND");
+ "ScpCommand", "CTEST_SCP_COMMAND", this->Quiet);
const char* notesFilesVariable
= this->Makefile->GetDefinition("CTEST_NOTES_FILES");
@@ -145,6 +149,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
static_cast<cmCTestSubmitHandler*>(handler)->SetOption("InternalTest",
this->InternalTest ? "ON" : "OFF");
+ handler->SetQuiet(this->Quiet);
+
if (this->CDashUpload)
{
static_cast<cmCTestSubmitHandler*>(handler)->
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 5b52df7..d585863 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -242,9 +242,9 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
*this->LogFile << "\tUpload file: " << local_file << " to "
<< upload_as << std::endl;
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
- << local_file << " to "
- << upload_as << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Upload file: " << local_file << " to " << upload_as << std::endl,
+ this->Quiet);
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
@@ -278,15 +278,15 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
if (!chunk.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
}
if (!chunkDebug.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
}
fclose(ftpfile);
@@ -318,8 +318,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
}
// always cleanup
::curl_easy_cleanup(curl);
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Uploaded: " + local_file
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Uploaded: " + local_file << std::endl, this->Quiet);
}
}
::curl_global_cleanup();
@@ -369,14 +369,14 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
cmCurlSetCAInfo(curl);
if(verifyPeerOff)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Set CURLOPT_SSL_VERIFYPEER to off\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Set CURLOPT_SSL_VERIFYPEER to off\n", this->Quiet);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
}
if(verifyHostOff)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Set CURLOPT_SSL_VERIFYHOST to off\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Set CURLOPT_SSL_VERIFYHOST to off\n", this->Quiet);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
}
@@ -482,9 +482,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
unsigned long filelen = cmSystemTools::FileLength(local_file);
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
- << local_file << " to "
- << upload_as << " Size: " << filelen << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Upload file: " << local_file << " to "
+ << upload_as << " Size: " << filelen << std::endl, this->Quiet);
// specify target
::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str());
@@ -529,16 +529,16 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
if (!chunk.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
this->ParseResponse(chunk);
}
if (!chunkDebug.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
}
// If curl failed for any reason, or checksum fails, wait and retry
@@ -557,8 +557,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
for(int i = 0; i < count; i++)
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " Submit failed, waiting " << delay << " seconds...\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Submit failed, waiting " << delay << " seconds...\n",
+ this->Quiet);
double stop = cmSystemTools::GetTime() + delay;
while(cmSystemTools::GetTime() < stop)
@@ -566,9 +567,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
cmSystemTools::Delay(100);
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Retry submission: Attempt " << (i + 1) << " of "
- << count << std::endl);
+ << count << std::endl, this->Quiet);
::fclose(ftpfile);
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
@@ -582,9 +583,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
if (!chunk.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
this->ParseResponse(chunk);
}
@@ -624,8 +625,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
}
// always cleanup
::curl_easy_cleanup(curl);
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Uploaded: " + local_file
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Uploaded: " + local_file << std::endl, this->Quiet);
}
}
::curl_global_cleanup();
@@ -677,6 +678,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
{
CURL *curl;
char error_buffer[1024];
+
/* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL);
@@ -756,8 +758,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
= url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+ "xmlfile=" + ofile;
*this->LogFile << "Trigger url: " << turl << std::endl;
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
- << turl << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Trigger url: " << turl << std::endl, this->Quiet);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_easy_setopt(curl, CURLOPT_URL, turl.c_str());
if ( curl_easy_perform(curl) )
@@ -786,25 +788,26 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
if (!chunk.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
+ << std::endl, this->Quiet);
}
if (!chunkDebug.empty())
{
- cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
+ cmCTestOptionalLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size())
- << "]" << std::endl);
+ << "]" << std::endl, this->Quiet);
}
// always cleanup
::curl_easy_cleanup(curl);
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl,
+ this->Quiet);
}
}
::curl_global_cleanup();
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Dart server triggered..."
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Dart server triggered..."
+ << std::endl, this->Quiet);
return true;
}
@@ -821,6 +824,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
{
return 0;
}
+
std::vector<const char*> argv;
argv.push_back(scp_command.c_str()); // Scp command
argv.push_back(scp_command.c_str()); // Dummy string for file
@@ -845,9 +849,9 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
argv[1] = lfname.c_str();
std::string rfname = url + "/" + remoteprefix + *file;
argv[2] = rfname.c_str();
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Execute \"" << argv[0]
- << "\" \"" << argv[1] << "\" \""
- << argv[2] << "\"" << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
+ << argv[2] << "\"" << std::endl, this->Quiet);
*this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
<< argv[2] << "\"" << std::endl;
@@ -858,8 +862,8 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
while(cmsysProcess_WaitForData(cp, &data, &length, 0))
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(data, length));
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(data, length), this->Quiet);
}
cmsysProcess_WaitForExit(cp, 0);
@@ -871,8 +875,8 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
retVal = cmsysProcess_GetExitValue(cp);
if ( retVal != 0 )
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\tSCP returned: "
- << retVal << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "\tSCP returned: " << retVal << std::endl, this->Quiet);
*this->LogFile << "\tSCP returned: " << retVal << std::endl;
problems ++;
}
@@ -927,6 +931,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
<< "\tdestination: " << destination << std::endl);
return 0;
}
+
cmCTest::SetOfStrings::const_iterator file;
bool problems = false;
for ( file = files.begin(); file != files.end(); ++file )
@@ -936,9 +941,9 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
lfname += "/" + *file;
std::string rfname = destination + "/" + remoteprefix + *file;
cmSystemTools::CopyFileAlways(lfname, rfname);
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: "
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: "
<< lfname << " to "
- << rfname << std::endl);
+ << rfname << std::endl, this->Quiet);
}
std::string tagDoneFile = destination + "/" + remoteprefix + "DONE";
cmSystemTools::Touch(tagDoneFile, true);
@@ -971,8 +976,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
xmlrpc_env_init(&env);
/* Call the famous server at UserLand. */
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submitting to: "
- << realURL.c_str() << " (" << remoteprefix.c_str() << ")" << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: "
+ << realURL.c_str() << " (" << remoteprefix.c_str() << ")" << std::endl,
+ this->Quiet);
cmCTest::SetOfStrings::const_iterator file;
for ( file = files.begin(); file != files.end(); ++file )
{
@@ -983,8 +989,8 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
{
local_file = localprefix + "/" + *file;
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submit file: "
- << local_file.c_str() << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submit file: "
+ << local_file.c_str() << std::endl, this->Quiet);
struct stat st;
if ( ::stat(local_file.c_str(), &st) )
{
@@ -1068,12 +1074,14 @@ void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod,
if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
{
url += this->CTest->GetCTestConfiguration("DropSiteUser");
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSiteUser").c_str());
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ this->CTest->GetCTestConfiguration("DropSiteUser").c_str(),
+ this->Quiet);
if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 )
{
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
- cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
+ this->Quiet);
}
url += "@";
}
@@ -1147,8 +1155,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< "datafilesmd5[0]=" << md5sum << "&"
<< "type=" << curl.Escape(typeString);
std::string fields = str.str();
- cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:"
- << url << "\nfile: " << file << "\n");
+ cmCTestOptionalLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:"
+ << url << "\nfile: " << file << "\n", this->Quiet);
std::string response;
if(!curl.HttpRequest(url, fields, response))
{
@@ -1156,8 +1164,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
"Error in HttpRequest\n" << response);
return -1;
}
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Request upload response: [" << response << "]\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Request upload response: [" << response << "]\n", this->Quiet);
Json::Value json;
Json::Reader reader;
if(!reader.parse(response, json))
@@ -1179,9 +1187,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
int datares = json["datafilesmd5"][0].asInt();
if(datares == 1)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "File already exists on CDash, skip upload "
- << file << "\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "File already exists on CDash, skip upload " << file << "\n",
+ this->Quiet);
return 0;
}
}
@@ -1213,8 +1221,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< reader.getFormattedErrorMessages() << "\n");
return -1;
}
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Upload file response: [" << response << "]\n");
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Upload file response: [" << response << "]\n", this->Quiet );
return 0;
}
@@ -1311,13 +1319,13 @@ int cmCTestSubmitHandler::ProcessHandler()
if (!this->HTTPProxy.empty())
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: "
- << this->HTTPProxy << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: "
+ << this->HTTPProxy << std::endl, this->Quiet);
}
if (!this->FTPProxy.empty())
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use FTP Proxy: "
- << this->FTPProxy << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Use FTP Proxy: "
+ << this->FTPProxy << std::endl, this->Quiet);
}
cmGeneratedFileStream ofs;
this->StartLogFile("Submit", ofs);
@@ -1349,16 +1357,16 @@ int cmCTestSubmitHandler::ProcessHandler()
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
std::string::size_type glen = gpath.size() + 1;
gpath = gpath + "/CoverageLog*";
- cmCTestLog(this->CTest, DEBUG, "Globbing for: " << gpath
- << std::endl);
+ cmCTestOptionalLog(this->CTest, DEBUG, "Globbing for: " << gpath
+ << std::endl, this->Quiet);
if ( cmSystemTools::SimpleGlob(gpath, gfiles, 1) )
{
size_t cc;
for ( cc = 0; cc < gfiles.size(); cc ++ )
{
gfiles[cc] = gfiles[cc].substr(glen);
- cmCTestLog(this->CTest, DEBUG, "Glob file: " << gfiles[cc]
- << std::endl);
+ cmCTestOptionalLog(this->CTest, DEBUG, "Glob file: " << gfiles[cc]
+ << std::endl, this->Quiet);
this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfiles[cc].c_str());
}
}
@@ -1398,14 +1406,14 @@ int cmCTestSubmitHandler::ProcessHandler()
cnt ++;
}
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "Submit files (using "
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files (using "
<< this->CTest->GetCTestConfiguration("DropMethod") << ")"
- << std::endl);
+ << std::endl, this->Quiet);
const char* specificTrack = this->CTest->GetSpecificTrack();
if ( specificTrack )
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Send to track: "
- << specificTrack << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Send to track: "
+ << specificTrack << std::endl, this->Quiet);
}
this->SetLogFile(&ofs);
@@ -1414,9 +1422,9 @@ int cmCTestSubmitHandler::ProcessHandler()
if ( dropMethod == "" || dropMethod == "ftp" )
{
ofs << "Using drop method: FTP" << std::endl;
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using FTP submit method"
- << std::endl
- << " Drop site: ftp://");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Using FTP submit method" << std::endl << " Drop site: ftp://",
+ this->Quiet);
std::string url = "ftp://";
url += cmCTest::MakeURLSafe(
this->CTest->GetCTestConfiguration("DropSiteUser")) + ":" +
@@ -1427,18 +1435,20 @@ int cmCTestSubmitHandler::ProcessHandler()
this->CTest->GetCTestConfiguration("DropLocation"));
if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration(
- "DropSiteUser").c_str());
+ "DropSiteUser").c_str(), this->Quiet);
if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
+ this->Quiet);
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "@");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet);
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSite")
- << this->CTest->GetCTestConfiguration("DropLocation") << std::endl);
+ << this->CTest->GetCTestConfiguration("DropLocation") << std::endl,
+ this->Quiet);
if ( !this->SubmitUsingFTP(buildDirectory + "/Testing/"
+ this->CTest->GetCurrentTag(),
files, prefix, url) )
@@ -1451,11 +1461,12 @@ int cmCTestSubmitHandler::ProcessHandler()
}
if(!this->CDash)
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method"
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Using HTTP trigger method"
<< std::endl
<< " Trigger site: "
<< this->CTest->GetCTestConfiguration("TriggerSite")
- << std::endl);
+ << std::endl, this->Quiet);
if ( !this->
TriggerUsingHTTP(files, prefix,
this->CTest->GetCTestConfiguration("TriggerSite")))
@@ -1465,8 +1476,8 @@ int cmCTestSubmitHandler::ProcessHandler()
ofs << " Problems when triggering via HTTP" << std::endl;
return -1;
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Submission successful" << std::endl, this->Quiet);
ofs << " Submission successful" << std::endl;
return 0;
}
@@ -1476,27 +1487,30 @@ int cmCTestSubmitHandler::ProcessHandler()
std::string url = dropMethod;
url += "://";
ofs << "Using drop method: " << dropMethod << std::endl;
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using HTTP submit method"
- << std::endl
- << " Drop site:" << url);
+ 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");
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSiteUser").c_str());
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ this->CTest->GetCTestConfiguration("DropSiteUser").c_str(),
+ this->Quiet);
if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
- cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
+ this->Quiet);
}
url += "@";
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "@");
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet);
}
url += this->CTest->GetCTestConfiguration("DropSite") +
this->CTest->GetCTestConfiguration("DropLocation");
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSite")
- << this->CTest->GetCTestConfiguration("DropLocation") << std::endl);
+ << this->CTest->GetCTestConfiguration("DropLocation") << std::endl,
+ this->Quiet);
if ( !this->SubmitUsingHTTP(buildDirectory + "/Testing/" +
this->CTest->GetCurrentTag(), files, prefix, url) )
{
@@ -1507,11 +1521,10 @@ int cmCTestSubmitHandler::ProcessHandler()
}
if(!this->CDash)
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using HTTP trigger method"
- << std::endl
- << " Trigger site: "
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Using HTTP trigger method" << std::endl << " Trigger site: "
<< this->CTest->GetCTestConfiguration("TriggerSite")
- << std::endl);
+ << std::endl, this->Quiet);
if ( !this->
TriggerUsingHTTP(files, prefix,
this->CTest->GetCTestConfiguration("TriggerSite")))
@@ -1530,8 +1543,10 @@ int cmCTestSubmitHandler::ProcessHandler()
}
else
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful" <<
- (this->HasWarnings ? ", with warnings." : "") << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Submission successful" <<
+ (this->HasWarnings ? ", with warnings." : "") << std::endl,
+ this->Quiet);
ofs << " Submission successful" <<
(this->HasWarnings ? ", with warnings." : "") << std::endl;
}
@@ -1542,8 +1557,8 @@ int cmCTestSubmitHandler::ProcessHandler()
{
#if defined(CTEST_USE_XMLRPC)
ofs << "Using drop method: XML-RPC" << std::endl;
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using XML-RPC submit method"
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Using XML-RPC submit method" << std::endl, this->Quiet);
std::string url = this->CTest->GetCTestConfiguration("DropSite");
prefix = this->CTest->GetCTestConfiguration("DropLocation");
if ( !this->SubmitUsingXMLRPC(buildDirectory + "/Testing/" +
@@ -1554,8 +1569,8 @@ int cmCTestSubmitHandler::ProcessHandler()
ofs << " Problems when submitting via XML-RPC" << std::endl;
return -1;
}
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
+ << std::endl, this->Quiet);
ofs << " Submission successful" << std::endl;
return 0;
#else
@@ -1593,8 +1608,8 @@ int cmCTestSubmitHandler::ProcessHandler()
return -1;
}
cmSystemTools::ChangeDirectory(oldWorkingDirectory);
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
+ << std::endl, this->Quiet);
ofs << " Submission successful" << std::endl;
return 0;
}
@@ -1609,8 +1624,8 @@ int cmCTestSubmitHandler::ProcessHandler()
std::string
oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(buildDirectory);
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: "
- << buildDirectory << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Change directory: " << buildDirectory << std::endl, this->Quiet);
if ( !this->SubmitUsingCP(
"Testing/"+this->CTest->GetCurrentTag(),
@@ -1626,8 +1641,8 @@ int cmCTestSubmitHandler::ProcessHandler()
return -1;
}
cmSystemTools::ChangeDirectory(oldWorkingDirectory);
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
- << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
+ << std::endl, this->Quiet);
ofs << " Submission successful" << std::endl;
return 0;
}