可执行基础测试
public abstract class ExecutableBaseTest
extends Object
implements IRemoteTest , IRuntimeHintProvider , ITestCollector , IShardableTest , IAbiReceiver , ITestFilterReceiver , IDiscoverDependencies
java.lang.Object | |
↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest |
可执行测试风格的基类。例如:二进制文件、shell 脚本。
概括
领域 | |
---|---|
public static final String | NO_BINARY_ERROR
|
公共构造函数 | |
---|---|
ExecutableBaseTest () |
公共方法 | |
---|---|
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) 添加要排除的测试的过滤器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 添加要包含的测试的过滤器的 |
void | addExcludeFilter (String filter) 添加要排除的测试的过滤器。 |
void | addIncludeFilter (String filter) 添加要包含的测试的过滤器。 |
void | clearExcludeFilters () 删除当前跟踪的所有排除过滤器。 |
void | clearIncludeFilters () 删除当前跟踪的所有包含过滤器。 |
abstract String | findBinary (String binary) 搜索二进制文件以便能够运行它。 |
IAbi | getAbi () |
boolean | getCollectTestsOnly () |
getExcludeFilters () 返回排除过滤器的当前 | |
getIncludeFilters () 返回包含过滤器的当前 | |
final long | getRuntimeHint () 返回测试的预期运行时间(以毫秒为单位)。 |
reportDependencies () | |
void | run ( TestInformation testInfo, ITestInvocationListener listener) 运行测试,并将结果报告给侦听器。 |
abstract void | runBinary (String binaryPath, ITestInvocationListener listener, TestDescription description) 实际上在给定路径上运行二进制文件。 |
final void | setAbi ( IAbi abi) |
final void | setCollectTestsOnly (boolean shouldCollectTest) 启用或禁用测试收集模式 |
final | split (int shardHint) |
受保护的方法 | |
---|---|
boolean | doesRunBinaryGenerateTestResults () |
TestDescription[] | getFilterDescriptions ( testCommands) getFilterDescriptions ( testCommands) |
String | getModuleId ( IInvocationContext context) |
long | getTimeoutPerBinaryMs () |
领域
无二进制错误
public static final String NO_BINARY_ERROR
公共构造函数
可执行基础测试
public ExecutableBaseTest ()
公共方法
添加排除过滤器
public void addExcludeFilter (String filter)
添加要排除的测试的过滤器。
参数 | |
---|---|
filter | String |
添加包含过滤器
public void addIncludeFilter (String filter)
添加要包含的测试的过滤器。
参数 | |
---|---|
filter | String |
清除排除过滤器
public void clearExcludeFilters ()
删除当前跟踪的所有排除过滤器。
清除包含过滤器
public void clearIncludeFilters ()
删除当前跟踪的所有包含过滤器。
查找二进制文件
public abstract String findBinary (String binary)
搜索二进制文件以便能够运行它。
参数 | |
---|---|
binary | String :二进制文件的路径或简单的二进制文件名称。 |
退货 | |
---|---|
String | 二进制文件的路径,如果未找到则为 null。 |
投掷 | |
---|---|
DeviceNotAvailableException |
仅获取收集测试
public boolean getCollectTestsOnly ()
退货 | |
---|---|
boolean |
获取运行时提示
public final long getRuntimeHint ()
返回测试的预期运行时间(以毫秒为单位)。该时间用于负载平衡分片执行
退货 | |
---|---|
long |
报告依赖关系
publicreportDependencies ()
退货 | |
---|---|
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试,并将结果报告给侦听器。
参数 | |
---|---|
testInfo | TestInformation : TestInformation 对象包含运行测试的有用信息。 |
listener | ITestInvocationListener :测试结果的ITestInvocationListener |
投掷 | |
---|---|
DeviceNotAvailableException |
运行二进制文件
public abstract void runBinary (String binaryPath, ITestInvocationListener listener, TestDescription description)
实际上在给定路径上运行二进制文件。
参数 | |
---|---|
binaryPath | String :二进制文件的路径。 |
listener | ITestInvocationListener :报告结果的侦听器。 |
description | TestDescription :测试正在进行中。 |
投掷 | |
---|---|
DeviceNotAvailableException |
仅设置收集测试
public final void setCollectTestsOnly (boolean shouldCollectTest)
启用或禁用测试收集模式
分裂
public finalsplit (int shardHint)
split()
的替代版本还提供尝试运行的 shardCount。这对于某些有时无法随意决定的测试运行者很有用。
参数 | |
---|---|
shardHint | int :尝试的分片计数。 |
退货 | |
---|---|
要单独执行的子测试的集合,如果测试当前不可分片,则为null |
受保护的方法
doesRunBinary生成测试结果
protected boolean doesRunBinaryGenerateTestResults ()
退货 | |
---|---|
boolean |
获取过滤器描述
protected TestDescription[] getFilterDescriptions (testCommands)
参数 | |
---|---|
testCommands |
退货 | |
---|---|
TestDescription[] |
获取模块ID
protected String getModuleId (IInvocationContext context)
参数 | |
---|---|
context | IInvocationContext |
退货 | |
---|---|
String |
getTimeoutPerBinaryMs
protected long getTimeoutPerBinaryMs ()
退货 | |
---|---|
long | 应用于每个二进制文件执行的超时。 |