{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class TestRunnable
Runnable to run a single am instrument command to execute a single test.
Nested types |
|
|---|---|
TestRunnable.RunFinishedListener |
Called at the end of a test run. |
Public functions |
|
|---|---|
TestRunnable |
legacyTestRunnable(Constructs a TestRunnable executes all tests in arguments. |
Unit |
run() |
TestRunnable |
singleTestRunnable(Constructs a TestRunnable which will run a single test. |
TestRunnable |
testCollectionRunnable(Constructs a TestRunnable which will ask the instrumentation to list out its tests. |
fun legacyTestRunnable(
context: Context,
secret: String,
arguments: Bundle,
outputStream: OutputStream,
listener: TestRunnable.RunFinishedListener
): TestRunnable
Constructs a TestRunnable executes all tests in arguments.
| Parameters | |
|---|---|
context: Context |
A context |
secret: String |
A string representing the speakeasy binder key |
arguments: Bundle |
contains arguments to be passed to the target instrumentation |
outputStream: OutputStream |
the stream to write the results of the test process |
listener: TestRunnable.RunFinishedListener |
a callback listener to know when the run has completed |
fun singleTestRunnable(
context: Context,
secret: String,
arguments: Bundle,
outputStream: OutputStream,
listener: TestRunnable.RunFinishedListener,
test: String
): TestRunnable
Constructs a TestRunnable which will run a single test.
| Parameters | |
|---|---|
context: Context |
A context |
secret: String |
A string representing the speakeasy binder key |
arguments: Bundle |
contains arguments to be passed to the target instrumentation |
outputStream: OutputStream |
the stream to write the results of the test process |
listener: TestRunnable.RunFinishedListener |
a callback listener to know when the run has completed |
test: String |
contains a specific test#method to run. Will override whatever is specified in the bundle. |
fun testCollectionRunnable(
context: Context,
secret: String,
arguments: Bundle,
outputStream: OutputStream,
listener: TestRunnable.RunFinishedListener
): TestRunnable
Constructs a TestRunnable which will ask the instrumentation to list out its tests.
| Parameters | |
|---|---|
context: Context |
A context |
secret: String |
A string representing the speakeasy binder key |
arguments: Bundle |
contains arguments to be passed to the target instrumentation |
outputStream: OutputStream |
the stream to write the results of the test process |
listener: TestRunnable.RunFinishedListener |
a callback listener to know when the run has completed |