diff options
author | Brad King <brad.king@kitware.com> | 2013-05-16 18:38:20 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-16 18:38:20 (GMT) |
commit | 07d84921781cc6ca729cd3b872c683f04e658f89 (patch) | |
tree | d38b5b3bdef1cc0831e84c0654b7a3aa3f0fc86e | |
parent | f2a0671259a1ac769dc2f4f3628aab2f938472ab (diff) | |
parent | e319e32b8c30d255ceea3ed1e133a7303aea9681 (diff) | |
download | CMake-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)
-rw-r--r-- | Source/CTest/cmProcess.cxx | 8 |
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; } |