Don't tar/gz ctest_upload() files
This commit is contained in:
parent
fbe435652d
commit
28cdd0a5be
@ -66,8 +66,8 @@ int cmCTestUploadHandler::ProcessHandler()
|
|||||||
cmCTestLog(this->CTest, OUTPUT,
|
cmCTestLog(this->CTest, OUTPUT,
|
||||||
"\tUpload file: " << it->c_str() << std::endl);
|
"\tUpload file: " << it->c_str() << std::endl);
|
||||||
ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n"
|
ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n"
|
||||||
<< "<Content compression=\"tar/gzip\" encoding=\"base64\">\n";
|
<< "<Content encoding=\"base64\">\n";
|
||||||
ofs << this->CTest->Base64GzipEncodeFile(*it);
|
ofs << this->CTest->Base64EncodeFile(*it);
|
||||||
ofs << "\n</Content>\n"
|
ofs << "\n</Content>\n"
|
||||||
<< "</File>\n";
|
<< "</File>\n";
|
||||||
}
|
}
|
||||||
|
@ -1600,8 +1600,16 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file)
|
|||||||
"encoding file: " << file << std::endl);
|
"encoding file: " << file << std::endl);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
long len = cmSystemTools::FileLength(tarFile.c_str());
|
std::string base64 = this->Base64EncodeFile(tarFile);
|
||||||
std::ifstream ifs(tarFile.c_str(), std::ios::in
|
cmSystemTools::RemoveFile(tarFile.c_str());
|
||||||
|
return base64;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::string cmCTest::Base64EncodeFile(std::string file)
|
||||||
|
{
|
||||||
|
long len = cmSystemTools::FileLength(file.c_str());
|
||||||
|
std::ifstream ifs(file.c_str(), std::ios::in
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
| std::ios::binary
|
| std::ios::binary
|
||||||
#endif
|
#endif
|
||||||
@ -1609,7 +1617,6 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file)
|
|||||||
unsigned char *file_buffer = new unsigned char [ len + 1 ];
|
unsigned char *file_buffer = new unsigned char [ len + 1 ];
|
||||||
ifs.read(reinterpret_cast<char*>(file_buffer), len);
|
ifs.read(reinterpret_cast<char*>(file_buffer), len);
|
||||||
ifs.close();
|
ifs.close();
|
||||||
cmSystemTools::RemoveFile(tarFile.c_str());
|
|
||||||
|
|
||||||
unsigned char *encoded_buffer
|
unsigned char *encoded_buffer
|
||||||
= new unsigned char [ static_cast<int>(
|
= new unsigned char [ static_cast<int>(
|
||||||
@ -1629,6 +1636,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file)
|
|||||||
return base64;
|
return base64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
|
bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
|
||||||
{
|
{
|
||||||
|
@ -195,6 +195,8 @@ public:
|
|||||||
|
|
||||||
//! tar/gzip and then base 64 encode a file
|
//! tar/gzip and then base 64 encode a file
|
||||||
std::string Base64GzipEncodeFile(std::string file);
|
std::string Base64GzipEncodeFile(std::string file);
|
||||||
|
//! base64 encode a file
|
||||||
|
std::string Base64EncodeFile(std::string file);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the time remaining that the script is allowed to run in
|
* Return the time remaining that the script is allowed to run in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user