AgpTestSuite

Added in 8.10.0-alpha05

@Incubating
interface AgpTestSuite : TestSuite


A test suite that runs with the Android Gradle Plugin.

An AgpTestSuite can run against a single multiple product flavors or variants. Users should use a combination of the targetProductFlavors and targetVariants to identify the final list of variants that will be tested.

Although this is not strictly necessary, if the test suite has source code, it will be recompiled for each variant it targets. This is to ensure the compatibility of the test suite with each variant individually.

TODO : resolve : should we allow to target BuildTypes ? A subsequent CL will introduce sub types for host vs devices tests and this comment

Summary

Public properties

MutableList<Pair<StringString>>

Sets the list of ProductFlavors this test suite will target.

MutableList<String>

Sets the list of Variants names this test suite will target

JUnitEngineSpec

Spec to identify the test engine that will be used to run this test suite.

Public properties

targetProductFlavors

Added in 8.10.0-alpha05
val targetProductFlavorsMutableList<Pair<StringString>>

Sets the list of ProductFlavors this test suite will target.

The list must be finalized during configuration time as we must create compilation and test tasks to execute the suites.

Each targeted product flavors is expressed as a pair with the product flavor dimension first and the product flavor value second.

targetProductFlavors and targetVariants are additive, which mean that a variant is selected if one of its product flavors is in the targetProductFlavors list OR if the variant name is in the targetVariants list.

targetVariants

Added in 8.10.0-alpha05
val targetVariantsMutableList<String>

Sets the list of Variants names this test suite will target

The list must be finalized during configuration time as we must create compilation and test tasks to execute the suites.

targetProductFlavors and targetVariants are additive, which mean that a variant is selected if one of its product flavors is in the targetProductFlavors list OR if the variant name is in the targetVariants list.

useJunitEngine

Added in 8.10.0-alpha05
val useJunitEngineJUnitEngineSpec

Spec to identify the test engine that will be used to run this test suite. Do not call this method if the test suite should use a dedicated test task. Calling this method will direct AGP to create a org.gradle.api.tasks.testing.Test task and configure it using the returned JUnitEngineSpec