summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorWouter Klouwen <wouter.klouwen@youview.com>2017-12-12 20:54:01 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-23 15:04:38 (GMT)
commit695951bc46fa4bc4eaf686c4ee6dce24c579bc45 (patch)
tree951a8e3d7f78d9cb9ec892a35fd15dab1a4f9d97 /Source/CTest/cmCTestCoverageHandler.cxx
parent9c52b587b6dfa54266bcebbe7e111d7dde437a75 (diff)
downloadCMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.zip
CMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.tar.gz
CMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.tar.bz2
CTest: introduce cmDuration
This commit introduces cmDuration as a typedef for std::chrono::duration<double, std::ratio<1>>. It is less verbose and provides for a point to put future common functionality for durations. No functional change intended.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 2a9fd72..856421f 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -3,6 +3,7 @@
#include "cmCTestCoverageHandler.h"
#include "cmCTest.h"
+#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmParseBlanketJSCoverage.h"
#include "cmParseCacheCoverage.h"
@@ -40,7 +41,7 @@ public:
{
this->Process = cmsysProcess_New();
this->PipeState = -1;
- this->TimeOut = std::chrono::duration<double>(-1);
+ this->TimeOut = cmDuration(-1);
}
~cmCTestRunProcess()
{
@@ -64,7 +65,7 @@ public:
}
}
void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; }
- void SetTimeout(std::chrono::duration<double> t) { this->TimeOut = t; }
+ void SetTimeout(cmDuration t) { this->TimeOut = t; }
bool StartProcess()
{
std::vector<const char*> args;
@@ -79,7 +80,7 @@ public:
}
cmsysProcess_SetOption(this->Process, cmsysProcess_Option_HideWindow, 1);
- if (this->TimeOut >= std::chrono::duration<double>::zero()) {
+ if (this->TimeOut >= cmDuration::zero()) {
cmsysProcess_SetTimeout(this->Process, this->TimeOut.count());
}
cmsysProcess_Execute(this->Process);
@@ -108,7 +109,7 @@ private:
cmsysProcess* Process;
std::vector<std::string> CommandLineStrings;
std::string WorkingDirectory;
- std::chrono::duration<double> TimeOut;
+ cmDuration TimeOut;
};
cmCTestCoverageHandler::cmCTestCoverageHandler()
@@ -1022,9 +1023,9 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
int retVal = 0;
*cont->OFS << "* Run coverage for: " << fileDir << std::endl;
*cont->OFS << " Command: " << command << std::endl;
- int res = this->CTest->RunCommand(
- covargs, &output, &errors, &retVal, tempDir.c_str(),
- std::chrono::duration<double>::zero() /*this->TimeOut*/);
+ int res = this->CTest->RunCommand(covargs, &output, &errors, &retVal,
+ tempDir.c_str(),
+ cmDuration::zero() /*this->TimeOut*/);
*cont->OFS << " Output: " << output << std::endl;
*cont->OFS << " Errors: " << errors << std::endl;
@@ -1387,9 +1388,9 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
int retVal = 0;
*cont->OFS << "* Run coverage for: " << fileDir << std::endl;
*cont->OFS << " Command: " << command << std::endl;
- int res = this->CTest->RunCommand(
- covargs, &output, &errors, &retVal, fileDir.c_str(),
- std::chrono::duration<double>::zero() /*this->TimeOut*/);
+ int res = this->CTest->RunCommand(covargs, &output, &errors, &retVal,
+ fileDir.c_str(),
+ cmDuration::zero() /*this->TimeOut*/);
*cont->OFS << " Output: " << output << std::endl;
*cont->OFS << " Errors: " << errors << std::endl;