summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wegner <michael_wegner@apple.com>2018-09-08 15:36:00 -0700
committerBrad King <brad.king@kitware.com>2018-09-25 08:20:57 -0400
commit62fbe5002aa23c7591e325e622e62a2d1ed789be (patch)
tree5a865631c9d43f6c8768f08b9d7d83e4d6ff12da
parent02c5091c905964b529020070b4b24616d8a3fbd8 (diff)
downloadcmake-62fbe5002aa23c7591e325e622e62a2d1ed789be.tar.gz
cmCTestRunTest: Thread number of completed tests through start APIs
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx4
-rw-r--r--Source/CTest/cmCTestRunTest.cxx7
-rw-r--r--Source/CTest/cmCTestRunTest.h4
3 files changed, 8 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 3e0c1ac882..f0260018e8 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -178,7 +178,7 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
this->Properties[test]->Directory + " : " +
std::strerror(workdir.GetLastResult()));
} else {
- if (testRun->StartTest(this->Total)) {
+ if (testRun->StartTest(this->Completed, this->Total)) {
return true;
}
}
@@ -440,7 +440,7 @@ void cmCTestMultiProcessHandler::FinishTestProcess(cmCTestRunTest* runner,
this->SetStopTimePassed();
}
if (started) {
- if (!this->StopTimePassed && runner->StartAgain()) {
+ if (!this->StopTimePassed && runner->StartAgain(this->Completed)) {
this->Completed--; // remove the completed test because run again
return;
}
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 57b12f1756..36604a5c4f 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -334,7 +334,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
return passed || skipped;
}
-bool cmCTestRunTest::StartAgain()
+bool cmCTestRunTest::StartAgain(size_t completed)
{
if (!this->RunAgain) {
return false;
@@ -349,7 +349,7 @@ bool cmCTestRunTest::StartAgain()
return true;
}
- this->StartTest(this->TotalNumberOfTests);
+ this->StartTest(completed, this->TotalNumberOfTests);
return true;
}
@@ -429,9 +429,10 @@ void cmCTestRunTest::StartFailure(std::string const& output)
}
// Starts the execution of a test. Returns once it has started
-bool cmCTestRunTest::StartTest(size_t total)
+bool cmCTestRunTest::StartTest(size_t completed, size_t total)
{
this->TotalNumberOfTests = total; // save for rerun case
+ static_cast<void>(completed);
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(2 * getNumWidth(total) + 8)
<< "Start "
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 8e24834fd9..ab8b0da502 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -65,7 +65,7 @@ public:
void CompressOutput();
// launch the test process, return whether it started correctly
- bool StartTest(size_t total);
+ bool StartTest(size_t completed, size_t total);
// capture and report the test results
bool EndTest(size_t completed, size_t total, bool started);
// Called by ctest -N to log the command string
@@ -73,7 +73,7 @@ public:
void ComputeWeightedCost();
- bool StartAgain();
+ bool StartAgain(size_t completed);
void StartFailure(std::string const& output);