summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-22 15:52:41 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-26 13:43:46 (GMT)
commit7c2767ef3b575bc4b27d4d57ab9f2d5d1acbd3ce (patch)
tree7d9320ba0015689d933f131638231108956eaf92 /Source/CTest
parent303e81343804d5ef271a3669c1e6cac558055ca1 (diff)
downloadCMake-7c2767ef3b575bc4b27d4d57ab9f2d5d1acbd3ce.zip
CMake-7c2767ef3b575bc4b27d4d57ab9f2d5d1acbd3ce.tar.gz
CMake-7c2767ef3b575bc4b27d4d57ab9f2d5d1acbd3ce.tar.bz2
cmCTestMultiProcessHandler: Explain testRun ownership in comments
The ownership semantics of the 'testRun' variable are subtle and may fool static analysers. Add comments explaining them for now. Later some refactoring could be done to clarify the code. Issue: #19610
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 2d07420..21d5595 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -189,10 +189,13 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
std::strerror(workdir.GetLastResult()));
} else {
if (testRun->StartTest(this->Completed, this->Total)) {
+ // Ownership of 'testRun' has moved to another structure.
+ // When the test finishes, FinishTestProcess will be called.
return true;
}
}
+ // Pass ownership of 'testRun'.
this->FinishTestProcess(testRun, false);
return false;
}