diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-12-21 20:47:29 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-12-21 20:47:29 (GMT) |
commit | a302b51db58e21698725c6304f7ab5da0decb8fb (patch) | |
tree | 80d24e4006e5384bcdba33b1f531f4e75cdb6e3b /Source/cmCTest.cxx | |
parent | 3ff0b940556f5e310daa1160c5d2844e63ffeb38 (diff) | |
download | CMake-a302b51db58e21698725c6304f7ab5da0decb8fb.zip CMake-a302b51db58e21698725c6304f7ab5da0decb8fb.tar.gz CMake-a302b51db58e21698725c6304f7ab5da0decb8fb.tar.bz2 |
Query the CDash web API to automate CDash version detection.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cf2907e..d886f4b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -304,9 +304,8 @@ void cmCTest::SetParallelLevel(int level) bool cmCTest::ShouldCompressTestOutput() { if(!this->ComputedCompressOutput) - { - std::string cdashVersion = - this->GetCTestConfiguration("CDashVersion"); + { + std::string cdashVersion = this->GetCDashVersion(); //version >= 1.6? bool cdashSupportsGzip = cmSystemTools::VersionCompare( cmSystemTools::OP_GREATER, cdashVersion.c_str(), "1.6") || @@ -319,6 +318,19 @@ bool cmCTest::ShouldCompressTestOutput() } //---------------------------------------------------------------------------- +std::string cmCTest::GetCDashVersion() +{ + //First query the server. If that fails, fall back to the local setting + std::string response; + std::string url = "http://"; + url += this->GetCTestConfiguration("DropSite") + "/CDash/api/getversion.php"; + + int res = cmSystemTools::HTTPRequest(url, cmSystemTools::HTTP_GET, response); + + return res ? this->GetCTestConfiguration("CDashVersion") : response; +} + +//---------------------------------------------------------------------------- cmCTest::Part cmCTest::GetPartFromName(const char* name) { // Look up by lower-case to make names case-insensitive. |