ExecutableBaseTest
public
abstract
class
ExecutableBaseTest
extends Object
implements
IAbiReceiver,
IConfigurationReceiver,
IDiscoverDependencies,
IRemoteTest,
IRuntimeHintProvider,
IShardableTest,
ITestCollector,
ITestFilterReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest |
可執行樣式測試的基礎類別。例如:二進位檔、殼層指令碼。
摘要
常數 | |
|---|---|
String |
NO_BINARY_ERROR
|
公用建構函式 | |
|---|---|
ExecutableBaseTest()
|
|
公用方法 | |
|---|---|
void
|
addAllExcludeFilters(
新增要排除的測試篩選器 |
void
|
addAllIncludeFilters(
新增要納入測試的篩選器 |
void
|
addExcludeFilter(String filter)
新增要排除的測試篩選器。 |
void
|
addIncludeFilter(String filter)
新增要納入的測試篩選條件。 |
void
|
clearExcludeFilters()
刪除目前追蹤的所有排除篩選器。 |
void
|
clearIncludeFilters()
刪除目前追蹤的所有包含篩選器。 |
abstract
String
|
findBinary(String binary)
搜尋二進位檔,以便執行。 |
IAbi
|
getAbi()
|
boolean
|
getCollectTestsOnly()
|
|
getExcludeFilters()
傳回排除篩選器的目前 |
|
getIncludeFilters()
傳回包含篩選器的目前 |
final
long
|
getRuntimeHint()
以毫秒為單位傳回測試的預期執行時間。 |
|
reportDependencies()
|
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
Runs the tests, and reports result to the listener. |
abstract
void
|
runBinary(String binaryPath, ITestInvocationListener listener, TestDescription description)
實際執行指定路徑的二進位檔。 |
final
void
|
setAbi(IAbi abi)
|
final
void
|
setCollectTestsOnly(boolean shouldCollectTest)
啟用或停用測試收集模式 |
void
|
setConfiguration(IConfiguration configuration)
注入使用的 |
FailureDescription
|
shouldAbortRun(TestDescription description)
檢查 testRun 是否應提早結束。 |
final
|
split(int shardHint)
|
受保護的方法 | |
|---|---|
boolean
|
doesRunBinaryGenerateTestResults()
|
boolean
|
doesRunBinaryGenerateTestRuns()
|
|
getAllTestCommands()
Convert mBinaryPaths to mTestCommands for consistency. |
IConfiguration
|
getConfiguration()
傳回測試設定。 |
TestDescription[]
|
getFilterDescriptions(
|
String
|
getModuleId(IInvocationContext context)
|
long
|
getTimeoutPerBinaryMs()
|
boolean
|
isTestFailed(String testName)
|
常數
NO_BINARY_ERROR
public static final String NO_BINARY_ERROR
常數值: 「Binary %s does not exist.」
公用建構函式
ExecutableBaseTest
public ExecutableBaseTest ()
公用方法
addAllExcludeFilters
public void addAllExcludeFilters (filters)
新增要排除的測試篩選器 ERROR(/Set)。
| 參數 | |
|---|---|
filters |
|
addAllIncludeFilters
public void addAllIncludeFilters (filters)
新增要納入測試的篩選器 ERROR(/Set)。
| 參數 | |
|---|---|
filters |
|
addExcludeFilter
public void addExcludeFilter (String filter)
新增要排除的測試篩選器。
| 參數 | |
|---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
新增要納入的測試篩選條件。
| 參數 | |
|---|---|
filter |
String |
clearExcludeFilters
public void clearExcludeFilters ()
刪除目前追蹤的所有排除篩選器。
clearIncludeFilters
public void clearIncludeFilters ()
刪除目前追蹤的所有包含篩選器。
findBinary
public abstract String findBinary (String binary)
搜尋二進位檔,以便執行。
| 參數 | |
|---|---|
binary |
String:二進位檔的路徑或二進位檔名稱。 |
| 傳回 | |
|---|---|
String |
二進位檔的路徑,如果找不到則為空值。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
getCollectTestsOnly
public boolean getCollectTestsOnly ()
| 傳回 | |
|---|---|
boolean |
|
getRuntimeHint
public final long getRuntimeHint ()
以毫秒為單位傳回測試的預期執行時間。這段時間用於平衡分片執行作業的負載
| 傳回 | |
|---|---|
long |
|
reportDependencies
publicreportDependencies ()
| 傳回 | |
|---|---|
|
|
得分
public void run (TestInformation testInfo, ITestInvocationListener listener)
執行測試,並向接聽程式回報結果。
| 參數 | |
|---|---|
testInfo |
TestInformation:包含執行測試的實用資訊的 TestInformation 物件。 |
listener |
ITestInvocationListener:測試結果的 ITestInvocationListener |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
runBinary
public abstract void runBinary (String binaryPath,
ITestInvocationListener listener,
TestDescription description)在指定路徑實際執行二進位檔。
| 參數 | |
|---|---|
binaryPath |
String:二進位檔的路徑。 |
listener |
ITestInvocationListener:要回報結果的接聽程式。 |
description |
TestDescription:測試正在進行中。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
setCollectTestsOnly
public final void setCollectTestsOnly (boolean shouldCollectTest)
啟用或停用測試收集模式
setConfiguration
public void setConfiguration (IConfiguration configuration)
插入使用的 IConfiguration。
| 參數 | |
|---|---|
configuration |
IConfiguration |
shouldAbortRun
public FailureDescription shouldAbortRun (TestDescription description)
檢查 testRun 是否應提早結束。
| 參數 | |
|---|---|
description |
TestDescription:測試正在進行中。 |
| 傳回 | |
|---|---|
FailureDescription |
如果執行迴圈應終止,則為 FailureDescription。 |
拆分
public finalsplit (int shardHint)
split() 的替代版本,也會提供嘗試執行的 shardCount。這項功能適用於有時無法任意決定的測試執行器。
| 參數 | |
|---|---|
shardHint |
int:嘗試的 Shard 數量。 |
| 傳回 | |
|---|---|
|
要個別執行的子測試集合,或測試目前無法分片時的 null |
受保護的方法
doesRunBinaryGenerateTestResults
protected boolean doesRunBinaryGenerateTestResults ()
| 傳回 | |
|---|---|
boolean |
|
doesRunBinaryGenerateTestRuns
protected boolean doesRunBinaryGenerateTestRuns ()
| 傳回 | |
|---|---|
boolean |
|
getAllTestCommands
protectedgetAllTestCommands ()
為求一致,請將 mBinaryPaths 轉換為 mTestCommands。
| 傳回 | |
|---|---|
|
testCommands 的 MapERROR(/LinkedHashMap)<string, string="">。</string,> |
getConfiguration
protected IConfiguration getConfiguration ()
傳回測試設定。
| 傳回 | |
|---|---|
IConfiguration |
IConfiguration |
getFilterDescriptions
protected TestDescription[] getFilterDescriptions (testCommands)
| 參數 | |
|---|---|
testCommands |
|
| 傳回 | |
|---|---|
TestDescription[] |
|
getModuleId
protected String getModuleId (IInvocationContext context)
| 參數 | |
|---|---|
context |
IInvocationContext |
| 傳回 | |
|---|---|
String |
|
getTimeoutPerBinaryMs
protected long getTimeoutPerBinaryMs ()
| 傳回 | |
|---|---|
long |
套用至每個二進位檔的執行逾時。 |
isTestFailed
protected boolean isTestFailed (String testName)
| 參數 | |
|---|---|
testName |
String |
| 傳回 | |
|---|---|
boolean |
|