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(
添加了要排除的测试的过滤条件的 |
void
|
addAllIncludeFilters(
添加要包含的测试的过滤条件的 |
void
|
addExcludeFilter(String filter)
添加了用于过滤要排除的测试的过滤条件。 |
void
|
addIncludeFilter(String filter)
添加了用于过滤要包含的测试的过滤条件。 |
void
|
clearExcludeFilters()
删除目前跟踪的所有排除过滤条件。 |
void
|
clearIncludeFilters()
删除当前跟踪的所有包含过滤条件。 |
ITestDevice
|
getDevice()
获取被测设备。 |
|
getExcludeFilters()
返回排除过滤条件的当前 |
|
getIncludeFilters()
返回包含过滤条件的当前 |
final
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
运行测试并向监听器报告结果。 |
void
|
setBuild(IBuildInfo buildInfo)
|
void
|
setDevice(ITestDevice device)
注入被测设备。 |
|
split(int shardCountHint)
|
受保护的方法 | |
|---|---|
String[]
|
buildCommandLineArray(String filePath, String configPath,
|
String[]
|
buildCommandLineArray(String filePath, String configPath)
|
|
filterTests(String[] testListLines, String runName, ITestInvocationListener listener)
|
String
|
getLogDirAbsolutePath()
|
File
|
getLogDirFile()
|
boolean
|
processYamlTestResults(InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName)
解析 Mobly 测试结果并生成结果报告。 |
void
|
reportLogs(File logDir, ITestInvocationListener listener)
|
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 ()
删除当前跟踪的所有包含过滤条件。
得分
public final void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试并向监听器报告结果。
| 参数 | |
|---|---|
testInfo |
TestInformation:包含运行测试的实用信息的 TestInformation 对象。 |
listener |
ITestInvocationListener:测试结果的 ITestInvocationListener |
分解
publicsplit (int shardCountHint)
split() 的替代版本,还提供尝试运行的分片数量。这对于有时无法任意做出决定的一些测试运行程序非常有用。
| 参数 | |
|---|---|
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
protectedfilterTests (String[] testListLines, String runName, ITestInvocationListener listener)
| 参数 | |
|---|---|
testListLines |
String |
runName |
String |
listener |
ITestInvocationListener |
| 返回 | |
|---|---|
|
|
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 |
|
reportLogs
protected void reportLogs (File logDir,
ITestInvocationListener listener)| 参数 | |
|---|---|
logDir |
File |
listener |
ITestInvocationListener |
updateConfigFile
protected void updateConfigFile (InputStream configInputStream,
Writer writer)| 参数 | |
|---|---|
configInputStream |
InputStream |
writer |
Writer |
| 抛出 | |
|---|---|
HarnessRuntimeException |
|