MoblyBinaryHostTest

public class MoblyBinaryHostTest
extends Object implements IBuildReceiver, IDeviceTest, IRemoteTest, IShardableTest, ITestFilterReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.mobly.MoblyBinaryHostTest


旨在从 Android 构建系统 (Soong) 运行 mobly python 二进制文件的主机测试

摘要

公共构造函数

MoblyBinaryHostTest()

公共方法

void addAllExcludeFilters( filters)

添加了要排除的测试的过滤条件的 ERROR(/Set)

void addAllIncludeFilters( filters)

添加了要包含的测试的过滤条件 ERROR(/Set)

void addExcludeFilter(String filter)

添加了要排除的测试的过滤条件。

void addIncludeFilter(String filter)

添加了用于指定要包含哪些测试的过滤条件。

void clearExcludeFilters()

删除当前跟踪的所有排除过滤条件。

void clearIncludeFilters()

删除当前跟踪的所有包含过滤条件。

ITestDevice getDevice()

获取被测设备。

getExcludeFilters()

返回排除过滤条件的当前 ERROR(/Set)

getIncludeFilters()

返回包含过滤器的当前 ERROR(/Set)

final void run(TestInformation testInfo, ITestInvocationListener listener)

运行测试,并将结果报告给监听器。

void setBuild(IBuildInfo buildInfo)
void setDevice(ITestDevice device)

注入被测设备。

split(int shardCountHint)

split() 的替代版本,还提供尝试运行的 shardCount。

受保护的方法

String[] buildCommandLineArray(String filePath, String configPath, tests)
String[] buildCommandLineArray(String filePath, String configPath)
filterTests(String[] testListLines, String runName, ITestInvocationListener listener)
MoblyArtifactReporter getArtifactReporter()
String getLogDirAbsolutePath()
File getLogDirFile()
boolean processYamlTestResults(InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName)

解析 Mobly 测试结果并生成结果报告。

void updateConfigFile(InputStream configInputStream, Writer writer)

公共构造函数

MoblyBinaryHostTest

public MoblyBinaryHostTest ()

公共方法

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

clearExcludeFilters

public void clearExcludeFilters ()

删除当前跟踪的所有排除过滤条件。

clearIncludeFilters

public void clearIncludeFilters ()

删除当前跟踪的所有包含过滤条件。

getDevice

public ITestDevice getDevice ()

获取被测设备。

返回
ITestDevice ITestDevice

getExcludeFilters

public  getExcludeFilters ()

返回排除过滤条件的当前 ERROR(/Set)

返回

getIncludeFilters

public  getIncludeFilters ()

返回包含过滤器的当前 ERROR(/Set)

返回

得分

public final void run (TestInformation testInfo, 
                ITestInvocationListener listener)

运行测试,并将结果报告给监听器。

参数
testInfo TestInformation:包含用于运行测试的实用信息的 TestInformation 对象。

listener ITestInvocationListener:测试结果的 ITestInvocationListener

setBuild

public void setBuild (IBuildInfo buildInfo)

参数
buildInfo IBuildInfo

setDevice

public void setDevice (ITestDevice device)

注入被测设备。

参数
device ITestDevice:要使用的 ITestDevice

分解

public  split (int shardCountHint)

split() 的替代版本,还提供尝试运行的 shardCount。这对于有时无法任意决定的某些测试运行程序非常有用。

参数
shardCountHint int:尝试的分片数量。

返回
要单独执行的子测试集合,如果测试目前不可分片,则为 null

受保护的方法

buildCommandLineArray

protected String[] buildCommandLineArray (String filePath, 
                String configPath, 
                 tests)

参数
filePath String

configPath String

tests

返回
String[]

buildCommandLineArray

protected String[] buildCommandLineArray (String filePath, 
                String configPath)

参数
filePath String

configPath String

返回
String[]

filterTests

protected  filterTests (String[] testListLines, 
                String runName, 
                ITestInvocationListener listener)

参数
testListLines String

runName String

listener ITestInvocationListener

返回

getArtifactReporter

protected MoblyArtifactReporter getArtifactReporter ()

返回
MoblyArtifactReporter

getLogDirAbsolutePath

protected String getLogDirAbsolutePath ()

返回
String

getLogDirFile

protected File getLogDirFile ()

返回
File

processYamlTestResults

protected boolean processYamlTestResults (InputStream inputStream, 
                MoblyYamlResultParser parser, 
                ITestInvocationListener listener, 
                String runName)

解析 Mobly 测试结果并生成结果报告。

参数
inputStream InputStream:用于读取 Mobly 测试结果文件的 InputStream 对象。

parser MoblyYamlResultParser:用于处理 Mobly 测试结果的 MoblyYamlResultParser 对象。

listener ITestInvocationListener:执行各种报告的 ITestInvocationListener 实例。

runName String:str,Mobly 测试二进制文件运行的名称。

返回
boolean

updateConfigFile

protected void updateConfigFile (InputStream configInputStream, 
                Writer writer)

参数
configInputStream InputStream

writer Writer

抛出
HarnessRuntimeException