Options for controlling unit tests execution.
Type | Name and description |
---|---|
def |
all(Closure configClosure) Configures all unit testing tasks. |
def |
applyConfiguration(org.gradle.api.tasks.testing.Test task) Configures a given test task. |
Whether unmocked methods from android.jar should throw exceptions or return default values (i.e. zero or null).
See Unit testing support for details.
Configures all unit testing tasks.
See org.gradle.api.tasks.testing.Test for available options.
Inside the closure you can check the name of the task to configure only some test tasks, e.g.
android { testOptions { unitTests.all { if (it.name == 'testDebug') { systemProperty 'debug', 'true' } } } }
Configures a given test task. The configuration closures that were passed to all(Closure) will be applied to it.
Not meant to be called from build scripts. The reason it exists is that tasks are created after the build scripts are evaluated, so users have to "register" their configuration closures first and we can only apply them later.