summaryrefslogtreecommitdiff
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-08 08:22:15 -0500
committerBrad King <brad.king@kitware.com>2017-12-08 11:09:49 -0500
commit548e8f6ffedb57fcdee56633ba454ae0ddf38983 (patch)
tree31e77da99bac6397669e597739d7de8d5197d61f /Source/cmCTest.cxx
parentde0035fdcccb4c8acc92bf1db0a76b3c1f18003f (diff)
downloadcmake-548e8f6ffedb57fcdee56633ba454ae0ddf38983.tar.gz
CTest: Simplify std::chrono::duration<double> conversion to double
The ratio of ticks to seconds for this type is 1, so we can just use its `count()` directly. This also avoids converting through the integer representation of `std::chrono::milliseconds`, which has a much smaller allowed range. Drop our `cmsysProcess_SetTimeout` wrapper as it is now very thin.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index ed45644ff3..902f1ae197 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -50,7 +50,6 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
-#include "cmProcess.h"
#include "cmProcessOutput.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
@@ -998,7 +997,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmsysProcess_SetCommand(cp, &*argv.begin());
cmsysProcess_SetWorkingDirectory(cp, dir);
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- cmsysProcess_SetTimeout(cp, timeout);
+ cmsysProcess_SetTimeout(cp, timeout.count());
cmsysProcess_Execute(cp);
// Initialize tick's
@@ -1186,7 +1185,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
- cmsysProcess_SetTimeout(cp, timeout);
+ cmsysProcess_SetTimeout(cp, timeout.count());
cmsysProcess_Execute(cp);
char* data;
@@ -2610,7 +2609,7 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
if (cmSystemTools::GetRunCommandHideConsole()) {
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
- cmsysProcess_SetTimeout(cp, timeout);
+ cmsysProcess_SetTimeout(cp, timeout.count());
cmsysProcess_Execute(cp);
std::vector<char> tempOutput;