谷歌基準測試
public class GoogleBenchmarkTest
extends Object
implements IDeviceTest , IRemoteTest , ITestFilterReceiver
java.lang.Object | |
↳ | com.android.tradefed.testtype.GoogleBenchmarkTest |
在給定裝置上執行 Google 基準測試包的測試。
概括
公共構造函數 | |
---|---|
GoogleBenchmarkTest () |
公共方法 | |
---|---|
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) 新增要排除的測試的過濾器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 新增要包含的測試的過濾器的 |
void | addExcludeFilter (String filter) 新增要排除的測試的過濾器。 |
void | addIncludeFilter (String filter) 新增要包含的測試的過濾器。 |
void | addModuleName (String moduleName) 新增Android原生基準測試模組來運作。 |
String | cleanFilter (String filter) |
void | clearExcludeFilters () 刪除目前追蹤的所有排除過濾器。 |
void | clearIncludeFilters () 刪除目前追蹤的所有包含過濾器。 |
ITestDevice | getDevice () 獲取被測設備。 |
getExcludeFilters () 傳回排除過濾器的目前 | |
getIncludeFilters () 傳回包含篩選器的目前 | |
getModuleNames () 取得要執行的 Android 原生基準測試模組。 | |
void | run ( TestInformation testInfo, ITestInvocationListener listener) 運行測試,並將結果報告給偵聽器。 |
void | setDevice ( ITestDevice device) 注入被測設備。 |
void | setReportRunName (String reportRunName) |
受保護的方法 | |
---|---|
String | executeCommand ( ITestDevice testDevice, String cmd, IShellOutputReceiver outputReceiver) 執行基準測試命令的幫助程序方法。 |
String | getFilterFlagForFilters ( filters) getFilterFlagForFilters ( filters) |
String | getFilterFlagForTests ( fitlererTests) getFilterFlagForTests ( fitlererTests) |
boolean | shouldSkipFile (String fullPath) 幫助方法來確定我們是否應該跳過給定文件的執行。 |
公共構造函數
谷歌基準測試
public GoogleBenchmarkTest ()
公共方法
新增排除過濾器
public void addExcludeFilter (String filter)
新增要排除的測試的過濾器。
參數 | |
---|---|
filter | String |
新增包含過濾器
public void addIncludeFilter (String filter)
新增要包含的測試的過濾器。
參數 | |
---|---|
filter | String |
新增模組名稱
public void addModuleName (String moduleName)
新增Android原生基準測試模組來運作。
參數 | |
---|---|
moduleName | String :要執行的本機測試模組的名稱 |
清潔過濾器
public String cleanFilter (String filter)
參數 | |
---|---|
filter | String |
退貨 | |
---|---|
String |
清除排除過濾器
public void clearExcludeFilters ()
刪除目前追蹤的所有排除過濾器。
清除包含過濾器
public void clearIncludeFilters ()
刪除目前追蹤的所有包含過濾器。
取得模組名稱
publicgetModuleNames ()
取得要執行的 Android 原生基準測試模組。
退貨 | |
---|---|
要執行的本機測試模組的名稱,如果未設定則為 null |
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
設定報表運行名稱
public void setReportRunName (String reportRunName)
參數 | |
---|---|
reportRunName | String |
受保護的方法
執行命令
protected String executeCommand (ITestDevice testDevice, String cmd, IShellOutputReceiver outputReceiver)
執行基準測試命令的幫助程序方法。如果命令太長而無法直接由 adb 執行,則會從臨時腳本執行。
參數 | |
---|---|
testDevice | ITestDevice :運行命令的設備 |
cmd | String : 要執行的命令字串 |
outputReceiver | IShellOutputReceiver :用於讀取測試結果的輸出接收器 |
退貨 | |
---|---|
String | 如果 outputReceiver 為 null,則 shell 輸出 |
投擲 | |
---|---|
DeviceNotAvailableException |
取得過濾器的過濾標誌
protected String getFilterFlagForFilters (filters)
參數 | |
---|---|
filters |
退貨 | |
---|---|
String |
取得測試過濾標誌
protected String getFilterFlagForTests (fitlererTests)
參數 | |
---|---|
fitlererTests |
退貨 | |
---|---|
String |
應該跳過文件
protected boolean shouldSkipFile (String fullPath)
幫助方法來確定我們是否應該跳過給定文件的執行。
參數 | |
---|---|
fullPath | String :相關文件的完整路徑 |
退貨 | |
---|---|
boolean | true 如果我們應該跳過所述文件。 |