谷歌基準測試
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 |
getFilterFlagForFilters
protected String getFilterFlagForFilters (filters)
參數 | |
---|---|
filters |
退貨 | |
---|---|
String |
getFilterFlagForTests
protected String getFilterFlagForTests (fitlererTests)
參數 | |
---|---|
fitlererTests |
退貨 | |
---|---|
String |
應該跳過文件
protected boolean shouldSkipFile (String fullPath)
確定我們是否應該跳過給定文件的執行的輔助方法。
參數 | |
---|---|
fullPath | String :相關文件的完整路徑 |
退貨 | |
---|---|
boolean | 如果我們應該跳過所述文件,則為真。 |