自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TestOption
public
class
TestOption
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.testmapping.TestOption
|
存储在 TEST_MAPPING 文件中设置的测试选项详细信息。
摘要
公共构造函数
TestOption
public TestOption (String name,
String value)
参数 |
name |
String |
value |
String |
公共方法
compareTo
public int compareTo (TestOption option)
equals
public boolean equals (Object obj)
getName
public String getName ()
getValue
public String getValue ()
hashCode
public int hashCode ()
isExclusive
public boolean isExclusive ()
检查该选项是否仅用于排除特定测试。
一些示例专有选项包括:
exclude-filter
negative-testname-filter (GTest)
test-file-exclude-filter (AndroidJUnitTest)
exclude-annotation (AndroidJUnitTest)
返回 |
boolean |
如果该选项仅用于排除特定测试,则为 true。 |
isInclusive
public boolean isInclusive ()
检查该选项是否用于仅包含特定测试。
一些包容性选项示例如下:
include-filter
positive-testname-filter (GTest)
test-file-include-filter (AndroidJUnitTest)
include-annotation (AndroidJUnitTest)
返回 |
boolean |
如果此选项用于仅包含特定测试,则为 true。 |
toString
public String toString ()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# TestOption\n==========\n\n\n`\npublic\n\n\nclass\nTestOption\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|--------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.util.testmapping.TestOption |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nStores the test option details set in a TEST_MAPPING file.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[TestOption](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#TestOption(java.lang.String,%20java.lang.String))`(String name, String value) ` |\n\n| ### Public methods ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[compareTo](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#compareTo(com.android.tradefed.util.testmapping.TestOption))`(`[TestOption](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html)` option) ` |\n| ` boolean` | ` `[equals](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#equals(java.lang.Object))`(Object obj) ` |\n| ` String` | ` `[getName](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#getName())`() ` |\n| ` String` | ` `[getValue](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#getValue())`() ` |\n| ` int` | ` `[hashCode](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#hashCode())`() ` |\n| ` boolean` | ` `[isExclusive](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#isExclusive())`() ` Check if the option is used to only exclude certain tests. |\n| ` boolean` | ` `[isInclusive](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#isInclusive())`() ` Check if the option is used to only include certain tests. |\n| ` String` | ` `[toString](../../../../../../../reference/tradefed/com/android/tradefed/util/testmapping/TestOption.html#toString())`() ` |\n\nPublic constructors\n-------------------\n\n### TestOption\n\n```\npublic TestOption (String name, \n String value)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-----------------|\n| `name` | `String` \u003cbr /\u003e |\n| `value` | `String` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### compareTo\n\n```\npublic int compareTo (TestOption option)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|---------------------|\n| `option` | `TestOption` \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### equals\n\n```\npublic boolean equals (Object obj)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-----------------|\n| `obj` | `Object` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### getName\n\n```\npublic String getName ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |\n\n### getValue\n\n```\npublic String getValue ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |\n\n### hashCode\n\n```\npublic int hashCode ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### isExclusive\n\n```\npublic boolean isExclusive ()\n```\n\nCheck if the option is used to only exclude certain tests.\n\nSome sample exclusive options are:\n\nexclude-filter\n\nnegative-testname-filter (GTest)\n\ntest-file-exclude-filter (AndroidJUnitTest)\n\nexclude-annotation (AndroidJUnitTest)\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|------------------------------------------------------------------|\n| `boolean` | true if the option is used to only exclude certain tests. \u003cbr /\u003e |\n\n### isInclusive\n\n```\npublic boolean isInclusive ()\n```\n\nCheck if the option is used to only include certain tests.\n\nSome sample inclusive options are:\n\ninclude-filter\n\npositive-testname-filter (GTest)\n\ntest-file-include-filter (AndroidJUnitTest)\n\ninclude-annotation (AndroidJUnitTest)\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|------------------------------------------------------------------|\n| `boolean` | true if the option is used to only include certain tests. \u003cbr /\u003e |\n\n### toString\n\n```\npublic String toString ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |"]]