自 2026 年起,为了与我们的主干稳定开发模型保持一致,并确保生态系统的平台稳定性,我们将在第 2 季度和第 4 季度向 AOSP 发布源代码。如需构建 AOSP 并为其贡献代码,请使用 android-latest-release。android-latest-release 清单分支将始终引用推送到 AOSP 的最新版本。如需了解详情,请参阅 AOSP 变更。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
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 二进制文件的主机测试
摘要
受保护的方法 |
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。
addAllIncludeFilters
public void addAllIncludeFilters (Set<String> filters)
添加用于指定要包含哪些测试的过滤条件Set。
addExcludeFilter
public void addExcludeFilter (String filter)
添加用于指定要排除哪些测试的过滤条件。
addIncludeFilter
public void addIncludeFilter (String filter)
添加用于指定要包含哪些测试的过滤条件。
clearExcludeFilters
public void clearExcludeFilters ()
删除当前跟踪的所有排除过滤条件。
clearIncludeFilters
public void clearIncludeFilters ()
删除当前跟踪的所有包含过滤条件。
getExcludeFilters
public Set<String> getExcludeFilters ()
返回当前的排除过滤条件Set。
getIncludeFilters
public Set<String> getIncludeFilters ()
返回当前的包含过滤条件Set。
setBuild
public void setBuild (IBuildInfo buildInfo)
setDevice
public void setDevice (ITestDevice device)
注入被测设备。
分解
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 |
buildCommandLineArray
protected String[] buildCommandLineArray (String filePath,
String configPath)
| 参数 |
filePath |
String |
configPath |
String |
buildCommandLineForListTests
protected String[] buildCommandLineForListTests (String filePath)
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 ()
getLogDirFile
protected File getLogDirFile ()
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 测试二进制文件运行的名称。 |
protected void updateConfigFile (InputStream configInputStream,
Writer writer)
| 参数 |
configInputStream |
InputStream |
writer |
Writer |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-06-22。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-06-22。"],[],[]]