summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmProcess.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/cmProcess.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/cmProcess.cxx')
-rw-r--r--Source/CTest/cmProcess.cxx19
1 files changed, 3 insertions, 16 deletions
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 69ffb33..0db66c3 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -5,16 +5,6 @@
#include "cmProcessOutput.h"
#include <iostream>
-void cmsysProcess_SetTimeout(cmsysProcess* process,
- std::chrono::duration<double> timeout)
-{
- cmsysProcess_SetTimeout(
- process,
- double(
- std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) /
- 1000.0);
-};
-
cmProcess::cmProcess()
{
this->Process = nullptr;
@@ -59,7 +49,7 @@ bool cmProcess::StartProcess()
cmsysProcess_SetWorkingDirectory(this->Process,
this->WorkingDirectory.c_str());
}
- cmsysProcess_SetTimeout(this->Process, this->Timeout);
+ cmsysProcess_SetTimeout(this->Process, this->Timeout.count());
cmsysProcess_SetOption(this->Process, cmsysProcess_Option_MergeOutput, 1);
cmsysProcess_Execute(this->Process);
return (cmsysProcess_GetState(this->Process) ==
@@ -115,10 +105,7 @@ int cmProcess::GetNextOutputLine(std::string& line,
{
cmProcessOutput processOutput(cmProcessOutput::UTF8);
std::string strdata;
- double waitTimeout =
- double(
- std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) /
- 1000.0;
+ double waitTimeout = timeout.count();
for (;;) {
// Look for lines already buffered.
if (this->Output.GetLine(line)) {
@@ -240,7 +227,7 @@ int cmProcess::ReportStatus()
void cmProcess::ChangeTimeout(std::chrono::duration<double> t)
{
this->Timeout = t;
- cmsysProcess_SetTimeout(this->Process, this->Timeout);
+ cmsysProcess_SetTimeout(this->Process, this->Timeout.count());
}
void cmProcess::ResetStartTime()