HostTestBuilder

Added in 8.9.0-alpha04

@Incubating
interface HostTestBuilder


Interface to turn on or off host tests. Host tests run on the development machine, UNIT_TEST_TYPE or SCREENSHOT_TEST_TYPE are examples of host tests.

Summary

Constants

const String

Host test type for default screenshot tests.

const String

Host test type for default unit tests.

Public properties

Boolean

Set to true if the variant's has any host tests, false otherwise.

Boolean

Specifies host test code coverage data collection by configuring the JacocoPlugin.

String

Type of the HostTest, which can be 'UNIT_TEST_TYPE or SCREENSHOT_TEST_TYPE for HostTests created by AGP.

Constants

SCREENSHOT_TEST_TYPE

Added in 8.9.0-alpha04
@Incubating
const val SCREENSHOT_TEST_TYPEString

Host test type for default screenshot tests.

UNIT_TEST_TYPE

Added in 8.9.0-alpha04
@Incubating
const val UNIT_TEST_TYPEString

Host test type for default unit tests.

Public properties

enable

Added in 8.9.0-alpha04
var enableBoolean

Set to true if the variant's has any host tests, false otherwise.

Not setting this value relies on the AGP default behavior for this host test type.

enableCodeCoverage

Added in 8.9.0-alpha04
Deprecated in 8.9.0-alpha04
var enableCodeCoverageBoolean

Specifies host test code coverage data collection by configuring the JacocoPlugin.

When enabled, the Jacoco plugin is applied and coverage data is collected by the Jacoco plugin. This can avoid unwanted build time instrumentation required to collect coverage data from other test types such as connected tests.

If the value is initialized from the DSL com.android.build.api.dsl.BuildType.enableUnitTestCoverage, it will be used for HasHostTestsBuilder.UNIT_TEST_TYPE.

type

Added in 8.9.0-alpha04
var typeString

Type of the HostTest, which can be 'UNIT_TEST_TYPE or SCREENSHOT_TEST_TYPE for HostTests created by AGP.

For new instances, set the type to something meaningful for users.