GoogleBenchmarkTest
public
class
GoogleBenchmarkTest
extends Object
implements
IDeviceTest,
IRemoteTest,
ITestFilterReceiver
java.lang.Object | |
↳ | com.android.tradefed.testtype.GoogleBenchmarkTest |
在特定裝置上執行 Google 基準測試套件的測試。
摘要
公用建構函式 | |
---|---|
GoogleBenchmarkTest()
|
公用方法 | |
---|---|
void
|
addAllExcludeFilters(
新增篩選器的 |
void
|
addAllIncludeFilters(
新增篩選器的 |
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)
|
受保護的方法 | |
---|---|
CommandResult
|
executeCommand(ITestDevice testDevice, String cmd)
執行基準測試指令的輔助方法。 |
String
|
getFilterFlagForFilters(
|
String
|
getFilterFlagForTests(
|
boolean
|
shouldSkipFile(String fullPath)
輔助方法,用於判斷是否應略過執行特定檔案。 |
公用建構函式
GoogleBenchmarkTest
public GoogleBenchmarkTest ()
公用方法
addAllExcludeFilters
public void addAllExcludeFilters (filters)
新增篩選器的 ERROR(/Set)
,用於排除要排除的測試。
參數 | |
---|---|
filters |
|
addAllIncludeFilters
public void addAllIncludeFilters (filters)
新增篩選器的 ERROR(/Set)
,用於指定要納入哪些測試。
參數 | |
---|---|
filters |
|
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 ()
刪除目前追蹤的所有包含篩選器。
getModuleNames
publicgetModuleNames ()
取得要執行的 Android 原生基準測試模組。
傳回 | |
---|---|
|
要執行的原生測試模組名稱,如果未設定,則為空值 |
得分
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)
執行基準測試指令的輔助方法。如果指令過長,無法直接由 ADB 執行,系統會透過暫時性指令碼執行。
參數 | |
---|---|
testDevice |
ITestDevice :要執行指令的裝置 |
cmd |
String :要執行的指令字串 |
傳回 | |
---|---|
CommandResult |
如果 outputReceiver 為空值,則會顯示 shell 輸出內容 |
擲回 | |
---|---|
DeviceNotAvailableException |
getFilterFlagForFilters
protected String getFilterFlagForFilters (filters)
參數 | |
---|---|
filters |
|
傳回 | |
---|---|
String |
getFilterFlagForTests
protected String getFilterFlagForTests (fitlererTests)
參數 | |
---|---|
fitlererTests |
|
傳回 | |
---|---|
String |
shouldSkipFile
protected boolean shouldSkipFile (String fullPath)
輔助方法,用於判斷是否應略過執行指定檔案。
參數 | |
---|---|
fullPath |
String :問題檔案的完整路徑 |
傳回 | |
---|---|
boolean |
如果我們應該略過該檔案,則為 true。 |