谷歌基准测试

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 如果我们应该跳过所述文件。