summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestCommand.cxx
diff options
context:
space:
mode:
authorWouter Klouwen <wouter.klouwen@youview.com>2017-11-20 20:55:13 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-04 15:43:14 (GMT)
commit66419bc04620c5748df77e2b563d65b0e97b623a (patch)
tree0c6e38ba923c4eb95c3d5d829c83a849d58eb52a /Source/CTest/cmCTestTestCommand.cxx
parent923b8fadd5fe6af56197cf3916a3292b60c0e8db (diff)
downloadCMake-66419bc04620c5748df77e2b563d65b0e97b623a.zip
CMake-66419bc04620c5748df77e2b563d65b0e97b623a.tar.gz
CMake-66419bc04620c5748df77e2b563d65b0e97b623a.tar.bz2
CTest: convert timeouts to std::chrono::duration
This commit continues the refactoring of CTest to adopt std::chrono. After the last sets of changes that introduced std::chrono::steady_clock and std::chrono::system_clock respectively, it makes sense to have all the timeouts be stored as std::chrono::duration. No functional change intended.
Diffstat (limited to 'Source/CTest/cmCTestTestCommand.cxx')
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index febd39e..232bd58 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -7,6 +7,7 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
+#include <chrono>
#include <sstream>
#include <stdlib.h>
#include <vector>
@@ -36,14 +37,14 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
const char* ctestTimeout =
this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
- double timeout;
+ std::chrono::duration<double> timeout;
if (ctestTimeout) {
- timeout = atof(ctestTimeout);
+ timeout = std::chrono::duration<double>(atof(ctestTimeout));
} else {
timeout = this->CTest->GetTimeOut();
- if (timeout <= 0) {
+ if (timeout <= std::chrono::duration<double>::zero()) {
// By default use timeout of 10 minutes
- timeout = 600;
+ timeout = std::chrono::minutes(10);
}
}
this->CTest->SetTimeOut(timeout);