cmCTestRunTest: Thread number of completed tests through start APIs

This commit is contained in:
Michael Wegner
2018-09-08 15:36:00 -07:00
committed by Brad King
parent 02c5091c90
commit 62fbe5002a
3 changed files with 8 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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 "

View File

@@ -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);