|
@@ -68,10 +68,10 @@ private:
|
|
|
return val;
|
|
return val;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- virtual void StartElement(const char* name, const char** atts)
|
|
|
|
|
|
|
+ virtual void StartElement(const std::string& name, const char** atts)
|
|
|
{
|
|
{
|
|
|
this->CurrentValue.clear();
|
|
this->CurrentValue.clear();
|
|
|
- if(strcmp(name, "cdash") == 0)
|
|
|
|
|
|
|
+ if(name == "cdash")
|
|
|
{
|
|
{
|
|
|
this->CDashVersion = this->FindAttribute(atts, "version");
|
|
this->CDashVersion = this->FindAttribute(atts, "version");
|
|
|
}
|
|
}
|
|
@@ -82,9 +82,9 @@ private:
|
|
|
this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
|
|
this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- virtual void EndElement(const char* name)
|
|
|
|
|
|
|
+ virtual void EndElement(const std::string& name)
|
|
|
{
|
|
{
|
|
|
- if(strcmp(name, "status") == 0)
|
|
|
|
|
|
|
+ if(name == "status")
|
|
|
{
|
|
{
|
|
|
std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
|
|
std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
|
|
|
if(status == "OK" || status == "SUCCESS")
|
|
if(status == "OK" || status == "SUCCESS")
|
|
@@ -100,15 +100,15 @@ private:
|
|
|
this->Status = STATUS_ERROR;
|
|
this->Status = STATUS_ERROR;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- else if(strcmp(name, "filename") == 0)
|
|
|
|
|
|
|
+ else if(name == "filename")
|
|
|
{
|
|
{
|
|
|
this->Filename = this->GetCurrentValue();
|
|
this->Filename = this->GetCurrentValue();
|
|
|
}
|
|
}
|
|
|
- else if(strcmp(name, "md5") == 0)
|
|
|
|
|
|
|
+ else if(name == "md5")
|
|
|
{
|
|
{
|
|
|
this->MD5 = this->GetCurrentValue();
|
|
this->MD5 = this->GetCurrentValue();
|
|
|
}
|
|
}
|
|
|
- else if(strcmp(name, "message") == 0)
|
|
|
|
|
|
|
+ else if(name == "message")
|
|
|
{
|
|
{
|
|
|
this->Message = this->GetCurrentValue();
|
|
this->Message = this->GetCurrentValue();
|
|
|
}
|
|
}
|
|
@@ -170,10 +170,10 @@ void cmCTestSubmitHandler::Initialize()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
-bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
|
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& url)
|
|
|
|
|
|
|
+bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& url)
|
|
|
{
|
|
{
|
|
|
CURL *curl;
|
|
CURL *curl;
|
|
|
CURLcode res;
|
|
CURLcode res;
|
|
@@ -217,12 +217,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
|
|
|
|
|
|
|
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
|
|
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
|
|
|
|
|
|
|
|
- cmStdString local_file = *file;
|
|
|
|
|
|
|
+ std::string local_file = *file;
|
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
|
{
|
|
{
|
|
|
local_file = localprefix + "/" + *file;
|
|
local_file = localprefix + "/" + *file;
|
|
|
}
|
|
}
|
|
|
- cmStdString upload_as
|
|
|
|
|
|
|
+ std::string upload_as
|
|
|
= url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
= url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
|
|
|
|
|
|
struct stat st;
|
|
struct stat st;
|
|
@@ -324,10 +324,10 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
// Uploading files is simpler
|
|
// Uploading files is simpler
|
|
|
-bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& url)
|
|
|
|
|
|
|
+bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& url)
|
|
|
{
|
|
{
|
|
|
CURL *curl;
|
|
CURL *curl;
|
|
|
CURLcode res;
|
|
CURLcode res;
|
|
@@ -336,8 +336,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|
|
|
|
|
|
|
/* In windows, this will init the winsock stuff */
|
|
/* In windows, this will init the winsock stuff */
|
|
|
::curl_global_init(CURL_GLOBAL_ALL);
|
|
::curl_global_init(CURL_GLOBAL_ALL);
|
|
|
- cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
|
|
|
|
- cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
|
|
|
|
|
|
|
+ std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
|
|
|
|
+ std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
|
|
|
std::vector<std::string> args;
|
|
std::vector<std::string> args;
|
|
|
cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
|
|
cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
|
|
|
bool verifyPeerOff = false;
|
|
bool verifyPeerOff = false;
|
|
@@ -354,7 +354,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|
|
verifyHostOff = true;
|
|
verifyHostOff = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- cmStdString::size_type kk;
|
|
|
|
|
|
|
+ std::string::size_type kk;
|
|
|
cmCTest::SetOfStrings::const_iterator file;
|
|
cmCTest::SetOfStrings::const_iterator file;
|
|
|
for ( file = files.begin(); file != files.end(); ++file )
|
|
for ( file = files.begin(); file != files.end(); ++file )
|
|
|
{
|
|
{
|
|
@@ -414,18 +414,18 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|
|
::curl_easy_setopt(curl, CURLOPT_PUT, 1);
|
|
::curl_easy_setopt(curl, CURLOPT_PUT, 1);
|
|
|
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
|
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
|
|
|
|
|
|
|
- cmStdString local_file = *file;
|
|
|
|
|
|
|
+ std::string local_file = *file;
|
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
|
{
|
|
{
|
|
|
local_file = localprefix + "/" + *file;
|
|
local_file = localprefix + "/" + *file;
|
|
|
}
|
|
}
|
|
|
- cmStdString remote_file
|
|
|
|
|
|
|
+ std::string remote_file
|
|
|
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
|
|
|
|
|
|
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
|
|
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
|
|
|
<< remote_file.c_str() << std::endl;
|
|
<< remote_file.c_str() << std::endl;
|
|
|
|
|
|
|
|
- cmStdString ofile = "";
|
|
|
|
|
|
|
+ std::string ofile = "";
|
|
|
for ( kk = 0; kk < remote_file.size(); kk ++ )
|
|
for ( kk = 0; kk < remote_file.size(); kk ++ )
|
|
|
{
|
|
{
|
|
|
char c = remote_file[kk];
|
|
char c = remote_file[kk];
|
|
@@ -448,8 +448,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|
|
ofile.append(hexCh);
|
|
ofile.append(hexCh);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- cmStdString upload_as
|
|
|
|
|
- = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
|
|
|
|
|
|
|
+ std::string upload_as
|
|
|
|
|
+ = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
|
|
|
+ "FileName=" + ofile;
|
|
+ "FileName=" + ofile;
|
|
|
|
|
|
|
|
upload_as += "&MD5=";
|
|
upload_as += "&MD5=";
|
|
@@ -666,9 +666,9 @@ void cmCTestSubmitHandler
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|
bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& url)
|
|
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& url)
|
|
|
{
|
|
{
|
|
|
CURL *curl;
|
|
CURL *curl;
|
|
|
char error_buffer[1024];
|
|
char error_buffer[1024];
|
|
@@ -721,10 +721,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|
|
::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
|
|
::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
|
|
|
::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
|
|
::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
|
|
|
|
|
|
|
|
- cmStdString rfile
|
|
|
|
|
|
|
+ std::string rfile
|
|
|
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
|
|
- cmStdString ofile = "";
|
|
|
|
|
- cmStdString::iterator kk;
|
|
|
|
|
|
|
+ std::string ofile = "";
|
|
|
|
|
+ std::string::iterator kk;
|
|
|
for ( kk = rfile.begin(); kk < rfile.end(); ++ kk)
|
|
for ( kk = rfile.begin(); kk < rfile.end(); ++ kk)
|
|
|
{
|
|
{
|
|
|
char c = *kk;
|
|
char c = *kk;
|
|
@@ -747,8 +747,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|
|
ofile.append(hexCh);
|
|
ofile.append(hexCh);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- cmStdString turl
|
|
|
|
|
- = url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
|
|
|
|
|
|
|
+ std::string turl
|
|
|
|
|
+ = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
|
|
|
+ "xmlfile=" + ofile;
|
|
+ "xmlfile=" + ofile;
|
|
|
*this->LogFile << "Trigger url: " << turl.c_str() << std::endl;
|
|
*this->LogFile << "Trigger url: " << turl.c_str() << std::endl;
|
|
|
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
|
|
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
|
|
@@ -805,11 +805,11 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
bool cmCTestSubmitHandler::SubmitUsingSCP(
|
|
bool cmCTestSubmitHandler::SubmitUsingSCP(
|
|
|
- const cmStdString& scp_command,
|
|
|
|
|
- const cmStdString& localprefix,
|
|
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& url)
|
|
|
|
|
|
|
+ const std::string& scp_command,
|
|
|
|
|
+ const std::string& localprefix,
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& url)
|
|
|
{
|
|
{
|
|
|
if ( !scp_command.size() || !localprefix.size() ||
|
|
if ( !scp_command.size() || !localprefix.size() ||
|
|
|
!files.size() || !remoteprefix.size() || !url.size() )
|
|
!files.size() || !remoteprefix.size() || !url.size() )
|
|
@@ -906,10 +906,10 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
bool cmCTestSubmitHandler::SubmitUsingCP(
|
|
bool cmCTestSubmitHandler::SubmitUsingCP(
|
|
|
- const cmStdString& localprefix,
|
|
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& destination)
|
|
|
|
|
|
|
+ const std::string& localprefix,
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& destination)
|
|
|
{
|
|
{
|
|
|
if ( !localprefix.size() ||
|
|
if ( !localprefix.size() ||
|
|
|
!files.size() || !remoteprefix.size() || !destination.size() )
|
|
!files.size() || !remoteprefix.size() || !destination.size() )
|
|
@@ -947,17 +947,17 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
|
#if defined(CTEST_USE_XMLRPC)
|
|
#if defined(CTEST_USE_XMLRPC)
|
|
|
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|
|
|
|
- const std::set<cmStdString>& files,
|
|
|
|
|
- const cmStdString& remoteprefix,
|
|
|
|
|
- const cmStdString& url)
|
|
|
|
|
|
|
+bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
|
|
|
|
|
+ const std::set<std::string>& files,
|
|
|
|
|
+ const std::string& remoteprefix,
|
|
|
|
|
+ const std::string& url)
|
|
|
{
|
|
{
|
|
|
xmlrpc_env env;
|
|
xmlrpc_env env;
|
|
|
char ctestString[] = "CTest";
|
|
char ctestString[] = "CTest";
|
|
|
std::string ctestVersionString = cmVersion::GetCMakeVersion();
|
|
std::string ctestVersionString = cmVersion::GetCMakeVersion();
|
|
|
char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
|
|
char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
|
|
|
|
|
|
|
|
- cmStdString realURL = url + "/" + remoteprefix + "/Command/";
|
|
|
|
|
|
|
+ std::string realURL = url + "/" + remoteprefix + "/Command/";
|
|
|
|
|
|
|
|
/* Start up our XML-RPC client library. */
|
|
/* Start up our XML-RPC client library. */
|
|
|
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
|
|
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
|
|
@@ -973,7 +973,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|
|
{
|
|
{
|
|
|
xmlrpc_value *result;
|
|
xmlrpc_value *result;
|
|
|
|
|
|
|
|
- cmStdString local_file = *file;
|
|
|
|
|
|
|
+ std::string local_file = *file;
|
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
|
|
{
|
|
{
|
|
|
local_file = localprefix + "/" + *file;
|
|
local_file = localprefix + "/" + *file;
|
|
@@ -1045,10 +1045,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
#else
|
|
#else
|
|
|
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&,
|
|
|
|
|
- std::set<cmStdString> const&,
|
|
|
|
|
- cmStdString const&,
|
|
|
|
|
- cmStdString const&)
|
|
|
|
|
|
|
+bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&,
|
|
|
|
|
+ std::set<std::string> const&,
|
|
|
|
|
+ std::string const&,
|
|
|
|
|
+ std::string const&)
|
|
|
{
|
|
{
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -1085,7 +1085,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|
|
}
|
|
}
|
|
|
if ( getenv("HTTP_PROXY_TYPE") )
|
|
if ( getenv("HTTP_PROXY_TYPE") )
|
|
|
{
|
|
{
|
|
|
- cmStdString type = getenv("HTTP_PROXY_TYPE");
|
|
|
|
|
|
|
+ std::string type = getenv("HTTP_PROXY_TYPE");
|
|
|
// HTTP/SOCKS4/SOCKS5
|
|
// HTTP/SOCKS4/SOCKS5
|
|
|
if ( type == "HTTP" )
|
|
if ( type == "HTTP" )
|
|
|
{
|
|
{
|
|
@@ -1122,7 +1122,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|
|
}
|
|
}
|
|
|
if ( getenv("FTP_PROXY_TYPE") )
|
|
if ( getenv("FTP_PROXY_TYPE") )
|
|
|
{
|
|
{
|
|
|
- cmStdString type = getenv("FTP_PROXY_TYPE");
|
|
|
|
|
|
|
+ std::string type = getenv("FTP_PROXY_TYPE");
|
|
|
// HTTP/SOCKS4/SOCKS5
|
|
// HTTP/SOCKS4/SOCKS5
|
|
|
if ( type == "HTTP" )
|
|
if ( type == "HTTP" )
|
|
|
{
|
|
{
|
|
@@ -1178,7 +1178,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|
|
this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml");
|
|
this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml");
|
|
|
if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml"))
|
|
if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml"))
|
|
|
{
|
|
{
|
|
|
- cmCTest::VectorOfStrings gfiles;
|
|
|
|
|
|
|
+ std::vector<std::string> gfiles;
|
|
|
std::string gpath
|
|
std::string gpath
|
|
|
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
|
|
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
|
|
|
std::string::size_type glen = gpath.size() + 1;
|
|
std::string::size_type glen = gpath.size() + 1;
|
|
@@ -1247,7 +1247,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|
|
}
|
|
}
|
|
|
this->SetLogFile(&ofs);
|
|
this->SetLogFile(&ofs);
|
|
|
|
|
|
|
|
- cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
|
|
|
|
|
|
+ std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
|
|
|
|
|
|
|
if ( dropMethod == "" || dropMethod == "ftp" )
|
|
if ( dropMethod == "" || dropMethod == "ftp" )
|
|
|
{
|
|
{
|