diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2017-12-12 20:54:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-23 15:04:38 (GMT) |
commit | 695951bc46fa4bc4eaf686c4ee6dce24c579bc45 (patch) | |
tree | 951a8e3d7f78d9cb9ec892a35fd15dab1a4f9d97 /Source/CTest/cmCTestBuildAndTestHandler.cxx | |
parent | 9c52b587b6dfa54266bcebbe7e111d7dde437a75 (diff) | |
download | CMake-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/cmCTestBuildAndTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 85d98d0..3383c9d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -19,7 +19,7 @@ cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() this->BuildTwoConfig = false; this->BuildNoClean = false; this->BuildNoCMake = false; - this->Timeout = std::chrono::duration<double>::zero(); + this->Timeout = cmDuration::zero(); } void cmCTestBuildAndTestHandler::Initialize() @@ -224,8 +224,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) this->BuildTargets.push_back(""); } for (std::string const& tar : this->BuildTargets) { - std::chrono::duration<double> remainingTime = std::chrono::seconds(0); - if (this->Timeout > std::chrono::duration<double>::zero()) { + cmDuration remainingTime = std::chrono::seconds(0); + if (this->Timeout > cmDuration::zero()) { remainingTime = this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { @@ -323,8 +323,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) out << "\n"; // how much time is remaining - std::chrono::duration<double> remainingTime = std::chrono::seconds(0); - if (this->Timeout > std::chrono::duration<double>::zero()) { + cmDuration remainingTime = std::chrono::seconds(0); + if (this->Timeout > cmDuration::zero()) { remainingTime = this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { @@ -395,7 +395,7 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments( } if (currentArg.find("--test-timeout", 0) == 0 && idx < allArgs.size() - 1) { idx++; - this->Timeout = std::chrono::duration<double>(atof(allArgs[idx].c_str())); + this->Timeout = cmDuration(atof(allArgs[idx].c_str())); } if (currentArg == "--build-generator" && idx < allArgs.size() - 1) { idx++; |