谷歌基准测试
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 | 如果我们应该跳过所述文件,则为真。 |