summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-05-16 18:38:20 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-05-16 18:38:20 (GMT)
commit07d84921781cc6ca729cd3b872c683f04e658f89 (patch)
treed38b5b3bdef1cc0831e84c0654b7a3aa3f0fc86e /Source/CTest
parentf2a0671259a1ac769dc2f4f3628aab2f938472ab (diff)
parente319e32b8c30d255ceea3ed1e133a7303aea9681 (diff)
downloadCMake-07d84921781cc6ca729cd3b872c683f04e658f89.zip
CMake-07d84921781cc6ca729cd3b872c683f04e658f89.tar.gz
CMake-07d84921781cc6ca729cd3b872c683f04e658f89.tar.bz2
Merge topic 'positive-test-times'
e319e32 CTest: make sure never to report negative test times (#14132)
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmProcess.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 000bc85..167b992 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -175,6 +175,14 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout)
// Record exit information.
this->ExitValue = cmsysProcess_GetExitValue(this->Process);
this->TotalTime = cmSystemTools::GetTime() - this->StartTime;
+ // Because of a processor clock scew the runtime may become slightly
+ // negative. If someone changed the system clock while the process was
+ // running this may be even more. Make sure not to report a negative
+ // duration here.
+ if (this->TotalTime <= 0.0)
+ {
+ this->TotalTime = 0.0;
+ }
// std::cerr << "Time to run: " << this->TotalTime << "\n";
return cmsysProcess_Pipe_None;
}