use of org.gradle.api.internal.tasks.testing.report.DefaultTestReport in project gradle by gradle.
the class AbstractTestTask method createReporting.
private void createReporting(Map<String, TestClassResult> results, TestOutputStore testOutputStore) {
TestResultsProvider testResultsProvider = new InMemoryTestResultsProvider(results.values(), testOutputStore);
try {
if (testReporter == null) {
testReporter = new DefaultTestReport(getBuildOperationExecutor());
}
JUnitXmlReport junitXml = reports.getJunitXml();
if (junitXml.isEnabled()) {
TestOutputAssociation outputAssociation = junitXml.isOutputPerTestCase() ? TestOutputAssociation.WITH_TESTCASE : TestOutputAssociation.WITH_SUITE;
Binary2JUnitXmlReportGenerator binary2JUnitXmlReportGenerator = new Binary2JUnitXmlReportGenerator(junitXml.getDestination(), testResultsProvider, outputAssociation, getBuildOperationExecutor(), getInetAddressFactory().getHostname());
binary2JUnitXmlReportGenerator.generate();
}
DirectoryReport html = reports.getHtml();
if (!html.isEnabled()) {
getLogger().info("Test report disabled, omitting generation of the HTML test report.");
} else {
testReporter.generateReport(testResultsProvider, html.getDestination());
}
} finally {
CompositeStoppable.stoppable(testResultsProvider).stop();
testReporter = null;
}
}
use of org.gradle.api.internal.tasks.testing.report.DefaultTestReport in project gradle by gradle.
the class TestReport method generateReport.
@TaskAction
void generateReport() {
TestResultsProvider resultsProvider = createAggregateProvider();
try {
if (resultsProvider.isHasResults()) {
DefaultTestReport testReport = new DefaultTestReport(getBuildOperationExecutor());
testReport.generateReport(resultsProvider, getDestinationDir());
} else {
getLogger().info("{} - no binary test results found in dirs: {}.", getPath(), getTestResultDirs().getFiles());
setDidWork(false);
}
} finally {
stoppable(resultsProvider).stop();
}
}
Aggregations