Commit 7af55318 authored by Zach's avatar Zach

Added support for CTest awareness of the CDash version. This will help...

Added support for CTest awareness of the CDash version.  This will help forward compatibility for both tools.  Note that this changeset effectively makes the default to disable output compression.  Now, to enable output compression, the CDASH_CTEST_VERSION must be explicity set to >= 1.6.  Automated detection of the CDash version is the next step.
parent cb27cfb1
......@@ -16,6 +16,7 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CDASH_VERSION "1.4")
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
......
......@@ -15,6 +15,7 @@ BuildName: @BUILDNAME@
# Submission information
IsCDash: @CTEST_DROP_SITE_CDASH@
CDashVersion: @CTEST_CDASH_VERSION@
DropSite: @DROP_SITE@
DropLocation: @DROP_LOCATION@
DropSiteUser: @DROP_SITE_USER@
......
......@@ -222,6 +222,7 @@ cmCTest::cmCTest()
this->RunConfigurationScript = false;
this->UseHTTP10 = false;
this->CompressTestOutput = true;
this->ComputedCompressOutput = false;
this->TestModel = cmCTest::EXPERIMENTAL;
this->MaxTestNameWidth = 30;
this->InteractiveDebugMode = true;
......@@ -299,6 +300,24 @@ void cmCTest::SetParallelLevel(int level)
this->ParallelLevel = level < 1 ? 1 : level;
}
//----------------------------------------------------------------------------
bool cmCTest::ShouldCompressTestOutput()
{
if(!this->ComputedCompressOutput)
{
std::string cdashVersion =
this->GetCTestConfiguration("CDashVersion");
//version >= 1.6?
bool cdashSupportsGzip = cmSystemTools::VersionCompare(
cmSystemTools::OP_GREATER, cdashVersion.c_str(), "1.6") ||
cmSystemTools::VersionCompare(cmSystemTools::OP_EQUAL,
cdashVersion.c_str(), "1.6");
this->CompressTestOutput &= cdashSupportsGzip;
this->ComputedCompressOutput = true;
}
return this->CompressTestOutput;
}
//----------------------------------------------------------------------------
cmCTest::Part cmCTest::GetPartFromName(const char* name)
{
......
......@@ -195,7 +195,7 @@ public:
bool ShouldUseHTTP10() { return this->UseHTTP10; }
bool ShouldCompressTestOutput() { return this->CompressTestOutput; }
bool ShouldCompressTestOutput();
//Used for parallel ctest job scheduling
std::string GetScheduleType() { return this->ScheduleType; }
......@@ -396,6 +396,9 @@ private:
bool RunConfigurationScript;
//flag for lazy getter (optimization)
bool ComputedCompressOutput;
int GenerateNotesFile(const char* files);
// these are helper classes
......
......@@ -2690,6 +2690,33 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
#endif
}
//----------------------------------------------------------------------------
bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
const char* lhss, const char* rhss)
{
unsigned int lhs[4] = {0,0,0,0};
unsigned int rhs[4] = {0,0,0,0};
sscanf(lhss, "%u.%u.%u.%u", &lhs[0], &lhs[1], &lhs[2], &lhs[3]);
sscanf(rhss, "%u.%u.%u.%u", &rhs[0], &rhs[1], &rhs[2], &rhs[3]);
// Do component-wise comparison.
for(unsigned int i=0; i < 4; ++i)
{
if(lhs[i] < rhs[i])
{
// lhs < rhs, so true if operation is LESS
return op == cmSystemTools::OP_LESS;
}
else if(lhs[i] > rhs[i])
{
// lhs > rhs, so true if operation is GREATER
return op == cmSystemTools::OP_GREATER;
}
}
// lhs == rhs, so true if operation is EQUAL
return op == cmSystemTools::OP_EQUAL;
}
//----------------------------------------------------------------------------
bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
bool* removed)
......
......@@ -268,6 +268,17 @@ public:
UNKNOWN_FILE_FORMAT
};
enum CompareOp {
OP_LESS,
OP_GREATER,
OP_EQUAL
};
/**
* Compare versions
*/
static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
/**
* Determine the file type based on the extension
*/
......
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