Commit 8b33507a authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'cdash_version_check'

d3633731 Do not query CDash for version
f725b20b Update tests that expect uncompressed output
parents a0b15968 d3633731
Pipeline #34855 passed with stage
in 0 seconds
......@@ -360,7 +360,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.EndElement(); // Results
xml.StartElement("Log");
if (this->CTest->ShouldCompressMemCheckOutput()) {
if (this->CTest->ShouldCompressTestOutput()) {
this->CTest->CompressString(memcheckstr);
xml.Attribute("compression", "gzip");
xml.Attribute("encoding", "base64");
......
......@@ -153,7 +153,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
if ((!this->TestHandler->MemCheck &&
this->CTest->ShouldCompressTestOutput()) ||
(this->TestHandler->MemCheck &&
this->CTest->ShouldCompressMemCheckOutput())) {
this->CTest->ShouldCompressTestOutput())) {
this->CompressOutput();
}
......
......@@ -46,7 +46,6 @@ public:
};
StatusType Status;
std::string CDashVersion;
std::string Filename;
std::string MD5;
std::string Message;
......@@ -63,12 +62,10 @@ private:
return val;
}
void StartElement(const std::string& name, const char** atts) CM_OVERRIDE
void StartElement(const std::string& /*name*/,
const char** /*atts*/) CM_OVERRIDE
{
this->CurrentValue.clear();
if (name == "cdash") {
this->CDashVersion = this->FindAttribute(atts, "version");
}
}
void CharacterDataHandler(const char* data, int length) CM_OVERRIDE
......@@ -470,20 +467,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
if (cmSystemTools::IsOn(this->GetOption("InternalTest")) &&
cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
this->CTest->GetCDashVersion().c_str(),
"1.7")) {
// mock failure output for internal test case
std::string mock_output =
"<cdash version=\"1.7.0\">\n"
" <status>ERROR</status>\n"
" <message>Checksum failed for file.</message>\n"
"</cdash>\n";
chunk.clear();
chunk.assign(mock_output.begin(), mock_output.end());
}
if (!chunk.empty()) {
cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size())
......
......@@ -271,7 +271,6 @@ cmCTest::cmCTest()
this->UseHTTP10 = false;
this->PrintLabels = false;
this->CompressTestOutput = true;
this->CompressMemCheckOutput = true;
this->TestModel = cmCTest::EXPERIMENTAL;
this->MaxTestNameWidth = 30;
this->InteractiveDebugMode = true;
......@@ -289,8 +288,6 @@ cmCTest::cmCTest()
this->DartVersion = 1;
this->DropSiteCDash = false;
this->OutputTestOutputOnTestFailure = false;
this->ComputedCompressTestOutput = false;
this->ComputedCompressMemCheckOutput = false;
this->RepeatTests = 1; // default to run each test once
this->RepeatUntilFail = false;
std::string outOnFail;
......@@ -358,53 +355,9 @@ void cmCTest::SetTestLoad(unsigned long load)
bool cmCTest::ShouldCompressTestOutput()
{
if (!this->ComputedCompressTestOutput) {
std::string cdashVersion = this->GetCDashVersion();
// version >= 1.6?
bool cdashSupportsGzip = cmSystemTools::VersionCompare(
cmSystemTools::OP_GREATER_EQUAL, cdashVersion.c_str(), "1.6");
this->CompressTestOutput &= cdashSupportsGzip;
this->ComputedCompressTestOutput = true;
}
return this->CompressTestOutput;
}
bool cmCTest::ShouldCompressMemCheckOutput()
{
if (!this->ComputedCompressMemCheckOutput) {
std::string cdashVersion = this->GetCDashVersion();
bool compressionSupported = cmSystemTools::VersionCompare(
cmSystemTools::OP_GREATER, cdashVersion.c_str(), "1.9.0");
this->CompressMemCheckOutput &= compressionSupported;
this->ComputedCompressMemCheckOutput = true;
}
return this->CompressMemCheckOutput;
}
std::string cmCTest::GetCDashVersion()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
// First query the server. If that fails, fall back to the local setting
std::string response;
std::string url = "http://";
url += this->GetCTestConfiguration("DropSite");
std::string cdashUri = this->GetCTestConfiguration("DropLocation");
cdashUri = cdashUri.substr(0, cdashUri.find("/submit.php"));
int res = 1;
if (!cdashUri.empty()) {
url += cdashUri + "/api/getversion.php";
res = cmCTest::HTTPRequest(url, cmCTest::HTTP_GET, response, "", "", 3);
}
return res ? this->GetCTestConfiguration("CDashVersion") : response;
#else
return this->GetCTestConfiguration("CDashVersion");
#endif
}
cmCTest::Part cmCTest::GetPartFromName(const char* name)
{
// Look up by lower-case to make names case-insensitive.
......@@ -1746,7 +1699,6 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--no-compress-output")) {
this->CompressTestOutput = false;
this->CompressMemCheckOutput = false;
}
if (this->CheckArgument(arg, "--print-labels")) {
......
......@@ -232,11 +232,8 @@ public:
bool ShouldPrintLabels() { return this->PrintLabels; }
bool ShouldCompressTestOutput();
bool ShouldCompressMemCheckOutput();
bool CompressString(std::string& str);
std::string GetCDashVersion();
std::string GetStopTime() { return this->StopTime; }
void SetStopTime(std::string const& time);
......@@ -487,10 +484,6 @@ private:
bool RunConfigurationScript;
// flag for lazy getter (optimization)
bool ComputedCompressTestOutput;
bool ComputedCompressMemCheckOutput;
int GenerateNotesFile(const char* files);
void DetermineNextDayStop();
......@@ -547,7 +540,6 @@ private:
bool CompressXMLFiles;
bool CompressTestOutput;
bool CompressMemCheckOutput;
void InitStreams();
std::ostream* StreamOut;
......
......@@ -135,6 +135,7 @@ function(run_TestOutputSize)
")
run_cmake_command(TestOutputSize
${CMAKE_CTEST_COMMAND} -M Experimental -T Test
--no-compress-output
--test-output-size-passed 10
--test-output-size-failed 12
)
......
......@@ -12,6 +12,7 @@ function(run_ctest CASE_NAME)
-S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
-V
--output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
--no-compress-output
${ARGN}
)
endfunction()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment