api / org.gradle.api.tasks.testing / TestResult

TestResult

interface TestResult

Describes a test result.

Types

ResultType

class ResultType

The final status of a test.

Functions

getEndTime

abstract fun getEndTime(): Long

Returns the time when this test completed execution.

getException

abstract fun getException(): Throwable

If the test failed with an exception, this will be the exception. Some test frameworks do not fail without an exception (JUnit), so in those cases this method will never return null.

getExceptions

abstract fun getExceptions(): MutableList<Throwable>

If the test failed with any exceptions, this will contain the exceptions. Some test frameworks do not fail without an exception (JUnit), so in those cases this method will never return an empty list.

getFailedTestCount

abstract fun getFailedTestCount(): Long

Returns the number of failed atomic tests executed for this test.

getResultType

abstract fun getResultType(): ResultType

Returns the type of result. Generally one wants it to be SUCCESS!

getSkippedTestCount

abstract fun getSkippedTestCount(): Long

Returns the number of skipped atomic tests executed for this test.

getStartTime

abstract fun getStartTime(): Long

Returns the time when this test started execution.

getSuccessfulTestCount

abstract fun getSuccessfulTestCount(): Long

Returns the number of successful atomic tests executed for this test.

getTestCount

abstract fun getTestCount(): Long

Returns the total number of atomic tests executed for this test. This will return 1 if this test is itself an atomic test.