Stay organized with collections
Save and categorize content based on your preferences.
HasUnitTest
interface HasUnitTest
Variants that optionally have unit test component
Summary
Public properties |
UnitTest? |
Variant's UnitTest , or null if the unit tests for this variant are disabled.
|
Public properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# HasUnitTest\n===========\n\n\n```\ninterface HasUnitTest\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[ApplicationVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/ApplicationVariant), [DynamicFeatureVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/DynamicFeatureVariant), [LibraryVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/LibraryVariant) \n\n|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| [ApplicationVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/ApplicationVariant) | Properties for the main Variant of an application. |\n| [DynamicFeatureVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/DynamicFeatureVariant) | |\n| [LibraryVariant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/LibraryVariant) | [Variant](/reference/tools/gradle-api/8.1/com/android/build/api/variant/Variant) for Library projects |\n\n*** ** * ** ***\n\nVariants that optionally have unit test component\n\nSummary\n-------\n\n| ### Public properties ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [UnitTest](/reference/tools/gradle-api/8.1/com/android/build/api/variant/UnitTest)`?` | [unitTest](/reference/tools/gradle-api/8.1/com/android/build/api/variant/HasUnitTest#unitTest()) Variant's [UnitTest](/reference/tools/gradle-api/8.1/com/android/build/api/variant/UnitTest), or null if the unit tests for this variant are disabled. |\n\nPublic properties\n-----------------\n\n### unitTest\n\n```\nval unitTest: UnitTest?\n```\n\nVariant's [UnitTest](/reference/tools/gradle-api/8.1/com/android/build/api/variant/UnitTest), or null if the unit tests for this variant are disabled."]]