summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-26 18:42:17 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-26 18:42:17 (GMT)
commit3503a79639f66bf3d2644c3d5fc1f6d28ca639b8 (patch)
tree41fc55d73a533fc9dc538a8dbfbd1d9ad03b665e /Source/CTest
parent4b266927c7556f74d11d6f499360d682117e0a60 (diff)
parent7fda917fa4897ec71c9a086f1f0fccae1c3d03d9 (diff)
downloadCMake-3503a79639f66bf3d2644c3d5fc1f6d28ca639b8.zip
CMake-3503a79639f66bf3d2644c3d5fc1f6d28ca639b8.tar.gz
CMake-3503a79639f66bf3d2644c3d5fc1f6d28ca639b8.tar.bz2
Merge branch 'backport-ctest-timeout-report' into ctest-timeout-report
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmProcess.cxx21
-rw-r--r--Source/CTest/cmProcess.h1
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 76ffb20..2742fd7 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -249,7 +249,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf)
this->PipeReader.reset();
if (this->ProcessHandleClosed) {
uv_timer_stop(this->Timer);
- this->Runner->FinalizeTest();
+ this->Finish();
}
}
@@ -291,7 +291,7 @@ void cmProcess::OnTimeout()
// Our on-exit handler already ran but did not finish the test
// because we were still reading output. We've just dropped
// our read handler, so we need to finish the test now.
- this->Runner->FinalizeTest();
+ this->Finish();
}
}
@@ -321,6 +321,16 @@ void cmProcess::OnExit(int64_t exit_status, int term_signal)
// Record exit information.
this->ExitValue = exit_status;
this->Signal = term_signal;
+
+ this->ProcessHandleClosed = true;
+ if (this->ReadHandleClosed) {
+ uv_timer_stop(this->Timer);
+ this->Finish();
+ }
+}
+
+void cmProcess::Finish()
+{
this->TotalTime = std::chrono::steady_clock::now() - this->StartTime;
// Because of a processor clock scew the runtime may become slightly
// negative. If someone changed the system clock while the process was
@@ -329,12 +339,7 @@ void cmProcess::OnExit(int64_t exit_status, int term_signal)
if (this->TotalTime <= cmDuration::zero()) {
this->TotalTime = cmDuration::zero();
}
-
- this->ProcessHandleClosed = true;
- if (this->ReadHandleClosed) {
- uv_timer_stop(this->Timer);
- this->Runner->FinalizeTest();
- }
+ this->Runner->FinalizeTest();
}
cmProcess::State cmProcess::GetProcessStatus()
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 0f69f68..526c920 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -108,6 +108,7 @@ private:
void OnAllocate(size_t suggested_size, uv_buf_t* buf);
void StartTimer();
+ void Finish();
class Buffer : public std::vector<char>
{