summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-12 13:02:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-12-12 13:02:33 (GMT)
commit1f5b2a8de93dc828d0cdc650478999133273c2c7 (patch)
tree7a0abc413deb20ee13a21065a7b6e0784d5fba41 /Source/CTest/cmCTestTestHandler.cxx
parent62d8bff146b28c10c11ad7ef8114f8d06f2fcad8 (diff)
parentba6caafa42afb7fa2c7d8d0d49c73d79efee1e9c (diff)
downloadCMake-1f5b2a8de93dc828d0cdc650478999133273c2c7.zip
CMake-1f5b2a8de93dc828d0cdc650478999133273c2c7.tar.gz
CMake-1f5b2a8de93dc828d0cdc650478999133273c2c7.tar.bz2
Merge topic 'fix-ctest-chrono'
ba6caafa CTest: Use integer-representable value for "infinite" timeout 548e8f6f CTest: Simplify std::chrono::duration<double> conversion to double de0035fd cmCTestBuildAndTestHandler: Convert timeout to std::chrono::duration 687a26b7 CTest: Fix regression in build-and-test timeout forwarding e770b1b8 CTest: Fix regression in build-and-test timeout compuatation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: dublet <github@dublet.org> Merge-request: !1574
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 9819899..4c7cefb 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -539,10 +539,8 @@ int cmCTestTestHandler::ProcessHandler()
this->PrintLabelOrSubprojectSummary(false);
}
char realBuf[1024];
- auto durationInMs = std::chrono::duration_cast<std::chrono::milliseconds>(
- clock_finish - clock_start)
- .count();
- sprintf(realBuf, "%6.2f sec", static_cast<double>(durationInMs) / 1000.0);
+ std::chrono::duration<double> durationInSecs = clock_finish - clock_start;
+ sprintf(realBuf, "%6.2f sec", durationInSecs.count());
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"\nTotal Test time (real) = " << realBuf << "\n",
this->Quiet);
@@ -653,10 +651,7 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject)
// only use labels found in labels
if (labels.find(l) != labels.end()) {
labelTimes[l] +=
- double(std::chrono::duration_cast<std::chrono::milliseconds>(
- result.ExecutionTime)
- .count()) /
- 1000.0 * result.Properties->Processors;
+ result.ExecutionTime.count() * result.Properties->Processors;
++labelCounts[l];
}
}
@@ -1324,11 +1319,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.StartElement("NamedMeasurement");
xml.Attribute("type", "numeric/double");
xml.Attribute("name", "Execution Time");
- xml.Element("Value",
- double(std::chrono::duration_cast<std::chrono::milliseconds>(
- result.ExecutionTime)
- .count()) /
- 1000.0);
+ xml.Element("Value", result.ExecutionTime.count());
xml.EndElement(); // NamedMeasurement
if (!result.Reason.empty()) {
const char* reasonType = "Pass Reason";