自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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)
等於
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 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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 |"]]