可執行基礎測試

public abstract class ExecutableBaseTest
extends Object implements IRemoteTest , IRuntimeHintProvider , ITestCollector , IShardableTest , IAbiReceiver , ITestFilterReceiver , IDiscoverDependencies

java.lang.Object
com.android.tradefed.testtype.binary.ExecutableBaseTest


可執行測試樣式的基類。例如:二進製文件、shell 腳本。

概括

字段

public static final String NO_BINARY_ERROR

公共構造函數

ExecutableBaseTest ()

公共方法

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

添加要排除的測試的過濾器的ERROR(/Set)

void addAllIncludeFilters ( filters) addAllIncludeFilters ( filters)

添加要包含哪些測試的過濾器的ERROR(/Set)

void addExcludeFilter (String filter)

添加要排除哪些測試的過濾器。

void addIncludeFilter (String filter)

添加要包含哪些測試的過濾器。

void clearExcludeFilters ()

刪除當前跟踪的所有排除過濾器。

void clearIncludeFilters ()

刪除當前跟踪的所有包含過濾器。

abstract String findBinary (String binary)

搜索二進製文件以運行它。

IAbi getAbi ()

getExcludeFilters ()

返回排除過濾器的當前ERROR(/Set)

getIncludeFilters ()

返回包含過濾器的當前ERROR(/Set)

final long getRuntimeHint ()

以毫秒為單位返回測試的預期運行時間。

reportDependencies ()
void run ( TestInformation testInfo, ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

abstract void runBinary (String binaryPath, ITestInvocationListener listener, TestDescription description)

實際上在給定路徑運行二進製文件。

final void setAbi ( IAbi abi)

final void setCollectTestsOnly (boolean shouldCollectTest)

啟用或禁用測試收集模式

final split (int shardHint)

split()的替代版本,它還提供嘗試運行的 shardCount。

受保護的方法

long getTimeoutPerBinaryMs ()

領域

NO_BINARY_ERROR

public static final String NO_BINARY_ERROR

公共構造函數

可執行基礎測試

public ExecutableBaseTest ()

公共方法

添加所有排除過濾器

public void addAllExcludeFilters ( filters)

添加要排除的測試的過濾器的ERROR(/Set)

參數
filters

添加所有包含過濾器

public void addAllIncludeFilters ( filters)

添加要包含哪些測試的過濾器的ERROR(/Set)

參數
filters

添加排除過濾器

public void addExcludeFilter (String filter)

添加要排除哪些測試的過濾器。

參數
filter String

添加包含過濾器

public void addIncludeFilter (String filter)

添加要包含哪些測試的過濾器。

參數
filter String

清除排除過濾器

public void clearExcludeFilters ()

刪除當前跟踪的所有排除過濾器。

清除包含過濾器

public void clearIncludeFilters ()

刪除當前跟踪的所有包含過濾器。

查找二進製文件

public abstract String findBinary (String binary)

搜索二進製文件以運行它。

參數
binary String :二進製文件的路徑或簡單的二進制名稱。

退貨
String二進製文件的路徑,如果未找到則為 null。

投擲
DeviceNotAvailableException

得到阿比

public IAbi getAbi ()

退貨
IAbi

獲取排除過濾器

public  getExcludeFilters ()

返回排除過濾器的當前ERROR(/Set)

退貨

getIncludeFilters

public  getIncludeFilters ()

返回包含過濾器的當前ERROR(/Set)

退貨

獲取運行時提示

public final long getRuntimeHint ()

以毫秒為單位返回測試的預期運行時間。該時間用於負載平衡分片執行

退貨
long

報告依賴關係

public  reportDependencies ()

退貨

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

參數
testInfo TestInformation :包含運行測試的有用信息的TestInformation對象。

listener ITestInvocationListener : 測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

運行二進製文件

public abstract void runBinary (String binaryPath, 
                ITestInvocationListener listener, 
                TestDescription description)

實際上在給定路徑運行二進製文件。

參數
binaryPath String :二進製文件的路徑。

listener ITestInvocationListener :報告結果的偵聽器。

description TestDescription :正在進行的測試。

投擲
DeviceNotAvailableException

設置Abi

public final void setAbi (IAbi abi)

參數
abi IAbi

setCollectTestsOnly

public final void setCollectTestsOnly (boolean shouldCollectTest)

啟用或禁用測試收集模式

分裂

public final  split (int shardHint)

split()的替代版本,它還提供嘗試運行的 shardCount。這對於某些有時不能隨意決定的測試運行器很有用。

參數
shardHint int :嘗試的分片數。

退貨
要單獨執行的子測試的集合,如果測試當前不可分片則為null

受保護的方法

getTimeoutPerBinaryMs

protected long getTimeoutPerBinaryMs ()

退貨
long應用於每個二進製文件執行的超時。