api / org.gradle.api.tasks.testing / TestReport

TestReport

@Incubating open class TestReport : DefaultTask

Generates an HTML test report from the results of one or more Test tasks.

Constructors

<init>

TestReport()

Generates an HTML test report from the results of one or more Test tasks.

Functions

getDestinationDir

open fun getDestinationDir(): File

Returns the directory to write the HTML report to.

getTestResultDirs

open fun getTestResultDirs(): FileCollection

Returns the set of binary test results to include in the report.

reportOn

open fun reportOn(vararg results: Any): Unit

Adds some results to include in the report.

This method accepts any parameter of the given types:

  • A Test task instance. The results from the test task are included in the report. The test task is automatically added as a dependency of this task.
  • Anything that can be converted to a set of File instances as per org.gradle.api.Project#files(Object...). These must point to the binary test results directory generated by a Test task instance.
  • An Iterable. The contents of the iterable are converted recursively.

setDestinationDir

open fun setDestinationDir(destinationDir: File): Unit

Sets the directory to write the HTML report to.

setTestResultDirs

open fun setTestResultDirs(testResultDirs: MutableIterable<File>): Unit

Sets the binary test results to use to include in the report. Each entry must point to a binary test results directory generated by a Test task.