谷歌基準測試

public class GoogleBenchmarkTest
extends Object implements IDeviceTest , IRemoteTest , ITestFilterReceiver

java.lang.Object
com.android.tradefed.testtype.GoogleBenchmarkTest


在給定裝置上執行 Google 基準測試包的測試。

概括

公共構造函數

GoogleBenchmarkTest ()

公共方法

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

新增要排除的測試的過濾器的ERROR(/Set)

void addAllIncludeFilters ( filters) addAllIncludeFilters ( filters)

新增要包含的測試的過濾器的ERROR(/Set)

void addExcludeFilter (String filter)

新增要排除的測試的過濾器。

void addIncludeFilter (String filter)

新增要包含的測試的過濾器。

void addModuleName (String moduleName)

新增Android原生基準測試模組來運作。

String cleanFilter (String filter)
void clearExcludeFilters ()

刪除目前追蹤的所有排除過濾器。

void clearIncludeFilters ()

刪除目前追蹤的所有包含過濾器。

ITestDevice getDevice ()

獲取被測設備。

getExcludeFilters ()

傳回排除過濾器的目前ERROR(/Set)

getIncludeFilters ()

傳回包含篩選器的目前ERROR(/Set)

getModuleNames ()

取得要執行的 Android 原生基準測試模組。

void run ( TestInformation testInfo, ITestInvocationListener listener)

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

void setDevice ( ITestDevice device)

注入被測設備。

void setReportRunName (String reportRunName)

受保護的方法

CommandResult executeCommand ( ITestDevice testDevice, String cmd)

執行基準測試命令的幫助程序方法。

String getFilterFlagForFilters ( filters) getFilterFlagForFilters ( filters)
String getFilterFlagForTests ( fitlererTests) getFilterFlagForTests ( fitlererTests)
boolean shouldSkipFile (String fullPath)

幫助方法來確定我們是否應該跳過給定文件的執行。

公共構造函數

谷歌基準測試

public GoogleBenchmarkTest ()

公共方法

新增所有排除過濾器

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 addModuleName (String moduleName)

新增Android原生基準測試模組來運作。

參數
moduleName String :要執行的本機測試模組的名稱

清潔過濾器

public String cleanFilter (String filter)

參數
filter String

退貨
String

清除排除過濾器

public void clearExcludeFilters ()

刪除目前追蹤的所有排除過濾器。

清除包含過濾器

public void clearIncludeFilters ()

刪除目前追蹤的所有包含過濾器。

取得設備

public ITestDevice getDevice ()

獲取被測設備。

退貨
ITestDevice ITestDevice

取得排除過濾器

public  getExcludeFilters ()

傳回排除過濾器的目前ERROR(/Set)

退貨

取得包含過濾器

public  getIncludeFilters ()

傳回包含篩選器的目前ERROR(/Set)

退貨

取得模組名稱

public  getModuleNames ()

取得要執行的 Android 原生基準測試模組。

退貨
要執行的本機測試模組的名稱,如果未設定則為 null

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

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

參數
testInfo TestInformationTestInformation物件包含執行測試的有用資訊。

listener ITestInvocationListener :測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設定設備

public void setDevice (ITestDevice device)

注入被測設備。

參數
device ITestDevice :要使用的ITestDevice

設定報表運行名稱

public void setReportRunName (String reportRunName)

參數
reportRunName String

受保護的方法

執行命令

protected CommandResult executeCommand (ITestDevice testDevice, 
                String cmd)

執行基準測試命令的幫助程序方法。如果命令太長而無法直接由 adb 執行,則會從臨時腳本執行。

參數
testDevice ITestDevice :運行命令的設備

cmd String : 要執行的命令字串

退貨
CommandResult如果 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 如果我們應該跳過所述文件。