8

I have several folders trying to seperate my tests up into unit, integration, 3rd party, db. This way I can have my tests seperated into chunks purposes, to make TDD easier/faster. Here is the task that I am trying to use.

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

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

I have 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

2 回答 2

9

I think you want

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

You may want to consult the api docs for TestTaskReports which shows that the html report is a DirectoryReport extending ConfigurableReport and that that provides the destination accessor referred to in the one liner above.

于 2013-10-11T20:34:50.053 回答
0

Maybe you can implement your own task of type TestReport similar to here. Note the feature is incubating though.

于 2013-10-11T20:28:58.877 回答