GoogleBenchmarkTest

public class GoogleBenchmarkTest
extends Object implements IDeviceTest, IRemoteTest, ITestFilterReceiver

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


這項測試會在指定裝置上執行 Google 基準測試套件。

摘要

公用建構函式

GoogleBenchmarkTest()

公用方法

void addAllExcludeFilters(Set<String> filters)

新增要排除的測試篩選器 Set

void addAllIncludeFilters(Set<String> filters)

新增要納入測試的篩選器 Set

void addExcludeFilter(String filter)

新增要排除的測試篩選器。

void addIncludeFilter(String filter)

新增要納入的測試篩選器。

void addModuleName(String moduleName)

新增要執行的 Android 原生基準測試模組。

String cleanFilter(String filter)
void clearExcludeFilters()

刪除目前追蹤的所有排除篩選器。

void clearIncludeFilters()

刪除目前追蹤的所有納入篩選器。

ITestDevice getDevice()

取得受測裝置。

Set<String> getExcludeFilters()

傳回排除篩選器的目前 Set

Set<String> getIncludeFilters()

傳回包含篩選器的目前 Set

List<String> getModuleNames()

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

void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setDevice(ITestDevice device)

注入受測裝置。

void setReportRunName(String reportRunName)

受保護的方法

CommandResult executeCommand(ITestDevice testDevice, String cmd)

Helper method to run a benchmarktest command.

String getFilterFlagForFilters(Set<String> filters)
String getFilterFlagForTests(Set<String> fitlererTests)
boolean shouldSkipFile(String fullPath)

輔助方法,用於判斷是否應略過特定檔案的執行作業。

公用建構函式

GoogleBenchmarkTest

public GoogleBenchmarkTest ()

公用方法

addAllExcludeFilters

public void addAllExcludeFilters (Set<String> filters)

新增要排除的測試篩選器 Set

參數
filters Set

addAllIncludeFilters

public void addAllIncludeFilters (Set<String> filters)

新增要納入測試的篩選器Set

參數
filters Set

addExcludeFilter

public void addExcludeFilter (String filter)

新增要排除的測試篩選器。

參數
filter String

addIncludeFilter

public void addIncludeFilter (String filter)

新增要納入的測試篩選條件。

參數
filter String

addModuleName

public void addModuleName (String moduleName)

新增要執行的 Android 原生基準測試模組。

參數
moduleName String:要執行的原生測試模組名稱

cleanFilter

public String cleanFilter (String filter)

參數
filter String

傳回
String

clearExcludeFilters

public void clearExcludeFilters ()

刪除目前追蹤的所有排除篩選器。

clearIncludeFilters

public void clearIncludeFilters ()

刪除目前追蹤的所有包含篩選器。

getDevice

public ITestDevice getDevice ()

取得受測裝置。

傳回
ITestDevice ITestDevice

getExcludeFilters

public Set<String> getExcludeFilters ()

傳回排除篩選器的目前 Set

傳回
Set<String>

getIncludeFilters

public Set<String> getIncludeFilters ()

傳回包含篩選器的目前 Set

傳回
Set<String>

getModuleNames

public List<String> getModuleNames ()

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

傳回
List<String> 要執行的原生測試模組名稱,如未設定則為空值

得分

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

執行測試,並向接聽程式回報結果。

參數
testInfo TestInformation:包含執行測試實用資訊的 TestInformation 物件。

listener ITestInvocationListener:測試結果的 ITestInvocationListener

擲回
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

注入測試裝置。

參數
device ITestDevice:要使用的 ITestDevice

setReportRunName

public void setReportRunName (String reportRunName)

參數
reportRunName String

受保護的方法

executeCommand

protected CommandResult executeCommand (ITestDevice testDevice, 
                String cmd)

Helper method to run a benchmarktest command. 如果指令過長,無法由 adb 直接執行,系統會透過臨時指令碼執行。

參數
testDevice ITestDevice:要在哪個裝置上執行指令

cmd String:要執行的指令字串

傳回
CommandResult 如果 outputReceiver 為空值,則為殼層輸出內容

擲回
DeviceNotAvailableException

getFilterFlagForFilters

protected String getFilterFlagForFilters (Set<String> filters)

參數
filters Set

傳回
String

getFilterFlagForTests

protected String getFilterFlagForTests (Set<String> fitlererTests)

參數
fitlererTests Set

傳回
String

shouldSkipFile

protected boolean shouldSkipFile (String fullPath)

輔助方法,用於判斷是否應略過特定檔案的執行作業。

參數
fullPath String:相關檔案的完整路徑

傳回
boolean 如果應略過上述檔案,則為 true。