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)
      用于运行 benchmarktest 命令的辅助方法。 | 
| 
        
        
        
        
        
        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 原生基准测试模块。
| 返回 | |
|---|---|
|  | 要运行的原生测试模块的名称,如果未设置,则为 null | 
得分
public void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试并向监听器报告结果。
| 参数 | |
|---|---|
| testInfo | TestInformation:包含运行测试的实用信息的TestInformation对象。 | 
| listener | ITestInvocationListener:测试结果的ITestInvocationListener | 
| 抛出 | |
|---|---|
| DeviceNotAvailableException | |
setReportRunName
public void setReportRunName (String reportRunName)
| 参数 | |
|---|---|
| reportRunName | String | 
受保护的方法
executeCommand
protected CommandResult executeCommand (ITestDevice testDevice, String cmd)
用于运行 benchmarktest 命令的辅助方法。如果命令过长,无法直接由 adb 运行,则会通过临时脚本运行。
| 参数 | |
|---|---|
| testDevice | ITestDevice:用于运行命令的设备 | 
| cmd | String:要运行的命令字符串 | 
| 返回 | |
|---|---|
| CommandResult | 如果 outputReceiver 为 null,则 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。 | 
