ENH: Cleanup the output

This commit is contained in:
Andy Cedilnik 2003-08-11 12:19:46 -04:00
parent 0b0a732f26
commit d9cb234d98
2 changed files with 103 additions and 95 deletions

View File

@ -1,17 +1,17 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
@ -24,7 +24,6 @@
cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
{
m_Verbose = false;
std::cout << "Setup proxy" << std::endl;
m_HTTPProxy = "";
m_HTTPProxyType = 0;
if ( getenv("HTTP_PROXY") )
@ -83,8 +82,14 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
}
}
}
std::cout << this << " HTTP Proxy: " << m_HTTPProxy << std::endl;
if ( m_HTTPProxy.size() > 0 )
{
std::cout << " Use HTTP Proxy: " << m_HTTPProxy << std::endl;
}
if ( m_FTPProxy.size() > 0 )
{
std::cout << " Use FTP Proxy: " << m_FTPProxy << std::endl;
}
}
bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
@ -138,12 +143,10 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
ftpfile = ::fopen(local_file.c_str(), "rb");
if ( m_Verbose )
{
std::cout << "upload file: " << local_file.c_str() << " to "
std::cout << " Upload file: " << local_file.c_str() << " to "
<< upload_as.c_str() << std::endl;
}
//std::cout << "File is opened: " << ftpfile << std::endl;
if ( m_Verbose )
{
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
@ -162,14 +165,14 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
fclose(ftpfile);
if ( res )
{
std::cout << "Error when uploading" << std::endl;
std::cout << " Error when uploading file: " << local_file.c_str() << std::endl;
::curl_easy_cleanup(curl);
::curl_global_cleanup();
return false;
}
// always cleanup
::curl_easy_cleanup(curl);
std::cout << "Uploaded: " + local_file << std::endl;
std::cout << " Uploaded: " + local_file << std::endl;
}
}
::curl_global_cleanup();
@ -182,7 +185,6 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
const std::string& remoteprefix,
const std::string& url)
{
std::cout << this << " Using proxy: " << m_HTTPProxy << std::endl;
CURL *curl;
CURLcode res;
FILE* ftpfile;
@ -261,7 +263,7 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
ftpfile = ::fopen(local_file.c_str(), "rb");
if ( m_Verbose )
{
std::cout << "upload file: " << local_file.c_str() << " to "
std::cout << " Upload file: " << local_file.c_str() << " to "
<< upload_as.c_str() << " Size: " << st.st_size << std::endl;
}
@ -281,13 +283,14 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
fclose(ftpfile);
if ( res )
{
std::cout << "Error when uploading" << std::endl;
std::cout << " Error when uploading file: " << local_file.c_str() << std::endl;
::curl_easy_cleanup(curl);
::curl_global_cleanup();
return false;
}
// always cleanup
::curl_easy_cleanup(curl);
std::cout << " Uploaded: " + local_file << std::endl;
}
}
::curl_global_cleanup();
@ -359,12 +362,12 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
std::string turl = url + "?xmlfile=" + ofile;
if ( m_Verbose )
{
std::cout << "Trigger url: " << turl.c_str() << std::endl;
std::cout << " Trigger url: " << turl.c_str() << std::endl;
}
curl_easy_setopt(curl, CURLOPT_URL, turl.c_str());
if ( curl_easy_perform(curl) )
{
std::cout << "Error when uploading" << std::endl;
std::cout << " Error when triggering: " << turl.c_str() << std::endl;
::curl_easy_cleanup(curl);
::curl_global_cleanup();
return false;
@ -375,7 +378,7 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
}
}
::curl_global_cleanup();
std::cout << "Dart server triggered..." << std::endl;
std::cout << " Dart server triggered..." << std::endl;
return true;
}

View File

@ -1919,7 +1919,7 @@ int cmCTest::SubmitResults()
if ( m_DartConfiguration["DropMethod"] == "" ||
m_DartConfiguration["DropMethod"] == "ftp" )
{
std::cout << "FTP submit method" << std::endl;
std::cout << " Using FTP submit method" << std::endl;
std::string url = "ftp://";
url += cmCTest::MakeURLSafe(m_DartConfiguration["DropSiteUser"]) + ":" +
cmCTest::MakeURLSafe(m_DartConfiguration["DropSitePassword"]) + "@" +
@ -1928,17 +1928,20 @@ int cmCTest::SubmitResults()
if ( !submit.SubmitUsingFTP(m_ToplevelPath+"/Testing/"+m_CurrentTag,
files, prefix, url) )
{
std::cout << " Problems when submitting via FTP" << std::endl;
return 0;
}
if ( !submit.TriggerUsingHTTP(files, prefix, m_DartConfiguration["TriggerSite"]) )
{
std::cout << " Problems when triggering via HTTP" << std::endl;
return 0;
}
std::cout << " Submission successfull" << std::endl;
return 1;
}
else if ( m_DartConfiguration["DropMethod"] == "http" )
{
std::cout << "HTTP submit method" << std::endl;
std::cout << " Using HTTP submit method" << std::endl;
std::string url = "http://";
if ( m_DartConfiguration["DropSiteUser"].size() > 0 )
{
@ -1952,13 +1955,15 @@ int cmCTest::SubmitResults()
url += m_DartConfiguration["DropSite"] + m_DartConfiguration["DropLocation"];
if ( !submit.SubmitUsingHTTP(m_ToplevelPath+"/Testing/"+m_CurrentTag, files, prefix, url) )
{
std::cout << " Problems when submitting via HTTP" << std::endl;
return 0;
}
if ( !submit.TriggerUsingHTTP(files, prefix, m_DartConfiguration["TriggerSite"]) )
{
std::cout << " Problems when triggering via HTTP" << std::endl;
return 0;
}
std::cout << "Submission successfull" << std::endl;
std::cout << " Submission successfull" << std::endl;
return 1;
}
else