summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.h
diff options
context:
space:
mode:
authorWouter Klouwen <wouter.klouwen@youview.com>2017-11-03 13:25:33 (GMT)
committerWouter Klouwen <wouter.klouwen@youview.com>2017-11-14 13:30:14 (GMT)
commite8a4036e9621d567fa47a118aa5583f85fae811a (patch)
tree904b467a4470c1d48d435334b8406902bac690b3 /Source/CTest/cmCTestTestHandler.h
parentb77501d4c7341337174f29cae623d8e1905af29a (diff)
downloadCMake-e8a4036e9621d567fa47a118aa5583f85fae811a.zip
CMake-e8a4036e9621d567fa47a118aa5583f85fae811a.tar.gz
CMake-e8a4036e9621d567fa47a118aa5583f85fae811a.tar.bz2
CTest: use std::chrono::steady_clock for time keeping
It was reported in issue #17345 that CTest does not use monotonic time to report test duration. Monotonic clocks are not affected by large NTP adjustments or things like daylight savings time. As CMake 3.10 requires C++11, which introduced std::chrono, this commit moves the time keeping in CTest from cmSystemTools::GetTime() to std::chrono::steady_clock. Fixes: #17345
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.h')
-rw-r--r--Source/CTest/cmCTestTestHandler.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 620e906..af85e72 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -8,6 +8,7 @@
#include "cmCTestGenericHandler.h"
#include "cmsys/RegularExpression.hxx"
+#include <chrono>
#include <iosfwd>
#include <map>
#include <set>
@@ -198,7 +199,7 @@ protected:
//! Clean test output to specified length
bool CleanTestOutput(std::string& output, size_t length);
- double ElapsedTestingTime;
+ std::chrono::duration<double> ElapsedTestingTime;
typedef std::vector<cmCTestTestResult> TestResultsVector;
TestResultsVector TestResults;