Specify Gradle Report Directory

I have several folders trying to split my tests into unit, integration, third-party, db. Thus, my tests can be divided into parts to make TDD easier and faster. Here is the task I'm trying to use.

task integrationTest(type: Test) {
    testClassesDir = sourceSets.integration.output.classesDir
    classpath = sourceSets.integration.runtimeClasspath
    maxParallelForks 8
    maxHeapSize = "4048m"
}

I know that testReportDir , but it is deprecated. I want to be able to use the new method.

I tried the following closures:

reports {
    html = file("$buildDir/reports/intTests")
}

reports {
    setDestination = file("$buildDir/reports/intTests")
}

reports {
    destinationDir = file("$buildDir/reports/intTests")
}

destinationDir = file("$buildDir/reports/intTests")
+4
source share
2 answers

I think you want

integrationTest.reports.html.destination = file("$buildDir/reports/intTests")

You can refer to the api docs for TestTaskReports, which shows that the html report is an DirectoryReportextension ConfigurableReportand that provides the destination mentioned above in one insert.

+7

, TestReport, . , .

0

All Articles