{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
interface ITestRunListener
TestRunResult |
Holds results from a single test run. |
Receives event notifications during instrumentation test runs.
Patterned after org.junit.runner.notification.RunListener
The sequence of calls will be:
This is a copy of com.android.ddmlib.testrunner.ITestRunListener.
Public functions |
|
|---|---|
Unit |
testAssumptionFailure(test: TestIdentifier, trace: String)Called when an atomic test flags that it assumes a condition that is false |
Unit |
testEnded(test: TestIdentifier, testMetrics: Map<String, String>)Reports the execution end of an individual test case. |
Unit |
testFailed(test: TestIdentifier, trace: String)Reports the failure of a individual test case. |
Unit |
testIgnored(test: TestIdentifier)Called when a test will not be run, generally because a test method is annotated with org.junit.Ignore. |
Unit |
testRunEnded(elapsedTime: Long, runMetrics: Map<String, String>)Reports end of test run. |
Unit |
testRunFailed(errorMessage: String)Reports test run failed to complete due to a fatal error. |
Unit |
testRunStarted(runName: String, testCount: Int)Reports the start of a test run. |
Unit |
testRunStopped(elapsedTime: Long)Reports test run stopped before completion due to a user request. |
Unit |
testStarted(test: TestIdentifier)Reports the start of an individual test case. |
fun testAssumptionFailure(test: TestIdentifier, trace: String): Unit
Called when an atomic test flags that it assumes a condition that is false
| Parameters | |
|---|---|
test: TestIdentifier |
identifies the test |
trace: String |
stack trace of failure |
fun testEnded(test: TestIdentifier, testMetrics: Map<String, String>): Unit
Reports the execution end of an individual test case.
If testFailed was not invoked, this test passed. Also returns any key/value metrics which may have been emitted during the test case's execution.
| Parameters | |
|---|---|
test: TestIdentifier |
identifies the test |
testMetrics: Map<String, String> |
a |
fun testFailed(test: TestIdentifier, trace: String): Unit
Reports the failure of a individual test case.
Will be called between testStarted and testEnded.
| Parameters | |
|---|---|
test: TestIdentifier |
identifies the test |
trace: String |
stack trace of failure |
fun testIgnored(test: TestIdentifier): Unit
Called when a test will not be run, generally because a test method is annotated with org.junit.Ignore.
| Parameters | |
|---|---|
test: TestIdentifier |
identifies the test |
fun testRunEnded(elapsedTime: Long, runMetrics: Map<String, String>): Unit
Reports end of test run.
fun testRunFailed(errorMessage: String): Unit
Reports test run failed to complete due to a fatal error.
fun testRunStarted(runName: String, testCount: Int): Unit
Reports the start of a test run.
fun testRunStopped(elapsedTime: Long): Unit
Reports test run stopped before completion due to a user request.
TODO: currently unused, consider removing
| Parameters | |
|---|---|
elapsedTime: Long |
device reported elapsed time, in milliseconds |
fun testStarted(test: TestIdentifier): Unit
Reports the start of an individual test case.
| Parameters | |
|---|---|
test: TestIdentifier |
identifies the test |