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(Set<String> filters)
添加用于指定要排除哪些测试的过滤条件 |
void
|
addAllIncludeFilters(Set<String> filters)
添加用于指定要包含哪些测试的过滤条件 |
void
|
addExcludeFilter(String filter)
添加用于指定要排除哪些测试的过滤条件。 |
void
|
addIncludeFilter(String filter)
添加用于指定要包含哪些测试的过滤条件。 |
void
|
clearExcludeFilters()
删除当前跟踪的所有排除过滤条件。 |
void
|
clearIncludeFilters()
删除当前跟踪的所有包含过滤条件。 |
ITestDevice
|
getDevice()
获取被测设备。 |
Set<String>
|
getExcludeFilters()
返回当前的排除过滤条件 |
Set<String>
|
getIncludeFilters()
返回当前的包含过滤条件 |
final
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
运行测试,并将结果报告给监听器。 |
void
|
setBuild(IBuildInfo buildInfo)
|
void
|
setDevice(ITestDevice device)
注入被测设备。 |
Collection<IRemoteTest>
|
split(int shardCountHint)
|
受保护的方法 | |
|---|---|
String[]
|
buildCommandLineArray(String filePath, String configPath, List<String> tests)
|
String[]
|
buildCommandLineArray(String filePath, String configPath)
|
String[]
|
buildCommandLineForListTests(String filePath)
|
Optional<Pair<List<String>, List<String>>>
|
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 (Set<String> filters)
添加用于指定要排除哪些测试的过滤条件Set。
| 参数 | |
|---|---|
filters |
Set |
addAllIncludeFilters
public void addAllIncludeFilters (Set<String> filters)
添加用于指定要包含哪些测试的过滤条件Set。
| 参数 | |
|---|---|
filters |
Set |
addExcludeFilter
public void addExcludeFilter (String filter)
添加用于指定要排除哪些测试的过滤条件。
| 参数 | |
|---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
添加用于指定要包含哪些测试的过滤条件。
| 参数 | |
|---|---|
filter |
String |
clearExcludeFilters
public void clearExcludeFilters ()
删除当前跟踪的所有排除过滤条件。
clearIncludeFilters
public void clearIncludeFilters ()
删除当前跟踪的所有包含过滤条件。
run
public final void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试,并将结果报告给监听器。
| 参数 | |
|---|---|
testInfo |
TestInformation:包含用于运行测试的实用信息的 TestInformation 对象。 |
listener |
ITestInvocationListener:测试结果的 ITestInvocationListener |
分解
public Collection<IRemoteTest> split (int shardCountHint)
split() 的替代版本,还提供尝试运行的 shardCount。这对于有时无法任意决定的某些测试运行程序非常有用。
| 参数 | |
|---|---|
shardCountHint |
int:尝试分片的数量。 |
| 返回 | |
|---|---|
Collection<IRemoteTest> |
要单独执行的子测试集合,如果测试目前无法分片,则为 null |
受保护的方法
buildCommandLineArray
protected String[] buildCommandLineArray (String filePath,
String configPath,
List<String> tests)| 参数 | |
|---|---|
filePath |
String |
configPath |
String |
tests |
List |
| 返回 | |
|---|---|
String[] |
|
buildCommandLineArray
protected String[] buildCommandLineArray (String filePath,
String configPath)| 参数 | |
|---|---|
filePath |
String |
configPath |
String |
| 返回 | |
|---|---|
String[] |
|
buildCommandLineForListTests
protected String[] buildCommandLineForListTests (String filePath)
| 参数 | |
|---|---|
filePath |
String |
| 返回 | |
|---|---|
String[] |
|
filterTests
protected Optional<Pair<List<String>, List<String>>> filterTests (String[] testListLines, String runName, ITestInvocationListener listener)
| 参数 | |
|---|---|
testListLines |
String |
runName |
String |
listener |
ITestInvocationListener |
| 返回 | |
|---|---|
Optional<Pair<List<String>, List<String>>> |
|
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 |
|