@@ -37,16 +37,19 @@ grpc::Status CoverageAndResultsGenerator::generate(bool withCoverage,
3737        }
3838    } catch  (CoverageGenerationException &e) {
3939        showErrors ();
40+         fs::remove (Paths::getGTestResultsJsonPath (projectContext));
4041        return  Status (StatusCode::FAILED_PRECONDITION, e.what ());
4142    } catch  (ExecutionProcessException &e) {
4243        exceptions.emplace_back (e);
4344        showErrors ();
45+         fs::remove (Paths::getGTestResultsJsonPath (projectContext));
4446        return  Status (StatusCode::FAILED_PRECONDITION, e.what ());
4547    } catch  (CancellationException &e) {
48+         fs::remove (Paths::getGTestResultsJsonPath (projectContext));
4649        return  Status::CANCELLED;
4750    }
48- 
4951    showErrors ();
52+     fs::remove (Paths::getGTestResultsJsonPath (projectContext));
5053    return  Status::OK;
5154}
5255
@@ -65,7 +68,7 @@ void CoverageAndResultsGenerator::showErrors() const {
6568        errorMessage = message;
6669    }
6770
68-     coverageAndResultsWriter->writeResponse (testStatusMap , coverageMap, totals, errorMessage);
71+     coverageAndResultsWriter->writeResponse (projectContext, testResultMap , coverageMap, totals, errorMessage);
6972}
7073
7174Coverage::CoverageMap const  &CoverageAndResultsGenerator::getCoverageMap () {
@@ -83,7 +86,7 @@ void CoverageAndResultsGenerator::collectCoverage() {
8386    }
8487    std::vector<ShellExecTask> coverageCommands = coverageTool->getCoverageCommands (
8588        CollectionUtils::filterToVector (testsToLaunch, [this ](const  UnitTest &testToLaunch) {
86-             return  testStatusMap [testToLaunch.testFilePath ][testToLaunch.testname ] !=
89+             return  testResultMap [testToLaunch.testFilePath ][testToLaunch.testname ]. status ()  !=
8790                   testsgen::TEST_INTERRUPTED;
8891        }));
8992    if  (coverageCommands.empty ()) {
0 commit comments