diff options
author | Brad King <brad.king@kitware.com> | 2018-01-26 13:27:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-26 13:27:37 (GMT) |
commit | f343106b19eec139764dc965f9110f503aafbf9c (patch) | |
tree | 2ad40ae416e4db8bad3c005f4650ad4d2c56f61c /Source/CTest/cmCTestBuildAndTestHandler.cxx | |
parent | b50fb70be8eb629083eb2ad2e0b413793bbdde06 (diff) | |
parent | e6a80ccfc440ac8dd5e9e5405744c2423560fc02 (diff) | |
download | CMake-f343106b19eec139764dc965f9110f503aafbf9c.zip CMake-f343106b19eec139764dc965f9110f503aafbf9c.tar.gz CMake-f343106b19eec139764dc965f9110f503aafbf9c.tar.bz2 |
Merge topic 'ctest-chrono'
e6a80ccf Make use of std::chrono throughout every component
ff62b005 CTest: add safe conversion from cmDuration to integer types
695951bc CTest: introduce cmDuration
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1592
Diffstat (limited to 'Source/CTest/cmCTestBuildAndTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 85d98d0..81089ca 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)) { @@ -251,7 +251,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) int retVal = cm.GetGlobalGenerator()->Build( this->SourceDir, this->BinaryDir, this->BuildProject, tar, output, this->BuildMakeProgram, config, !this->BuildNoClean, false, false, - remainingTime.count()); + remainingTime); out << output; // if the build failed then return if (retVal) { @@ -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++; |