ArtRun测试
public class ArtRunTest
extends Object
implements IRemoteTest , IAbiReceiver , ITestFilterReceiver , ITestCollector
java.lang.Object | |
↳ | com.android.tradefed.testtype.ArtRunTest |
运行 ART 运行测试的测试运行器。
概括
嵌套类 | |
---|---|
class | ArtRunTest.AdbShellCommandException 一个异常类,用于报告在执行 ADB shell 命令期间发生的错误。 |
领域 | |
---|---|
public static final String | CHECKER_PAR_FILENAME
|
公共构造函数 | |
---|---|
ArtRunTest () |
公共方法 | |
---|---|
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) 添加要排除的测试的过滤器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 添加要包含哪些测试的过滤器的 |
void | addExcludeFilter (String filter) 添加要排除哪些测试的过滤器。 |
void | addIncludeFilter (String filter) 添加要包含哪些测试的过滤器。 |
void | clearExcludeFilters () 删除当前跟踪的所有排除过滤器。 |
void | clearIncludeFilters () 删除当前跟踪的所有包含过滤器。 |
IAbi | getAbi () |
getExcludeFilters () 返回排除过滤器的当前 | |
getIncludeFilters () 返回包含过滤器的当前 | |
void | run ( TestInformation testInfo, ITestInvocationListener listener) 运行测试,并将结果报告给侦听器。 |
void | setAbi ( IAbi abi) |
void | setCollectTestsOnly (boolean shouldCollectTest) 启用或禁用测试收集模式 |
受保护的方法 | |
---|---|
checkExitCode (Integer exitCode) 检查测试命令返回的退出代码。 | |
checkTestOutput ( TestInformation testInfo, String actualOutputText, String outputShortName, String outputPrettyName) 检查测试命令产生的输出。 | |
File | createTestLocalTempDirectory ( TestInformation testInfo) 在测试的依赖项文件夹中创建一个本地临时目录,以收集从被测设备中提取的测试输出。 |
executeCheckerTest ( TestInformation testInfo, ITestInvocationListener listener) 执行 Checker 测试并检查其输出。 | |
void | extractSourcesFromJar (File tmpCheckerLocalDir, File jar) 从给定的 jar 文件中提取 src 目录到给定的目录。 |
File | getCheckerBinaryPath ( TestInformation testInfo) 找到 Checker 二进制文件(Python 存档)。 |
runChecker (String[] checkerCommandLine) 运行 Checker 命令并检查其结果。 |
领域
CHECKER_PAR_FILENAME
public static final String CHECKER_PAR_FILENAME
公共构造函数
ArtRun测试
public ArtRunTest ()
公共方法
添加排除过滤器
public void addExcludeFilter (String filter)
添加要排除哪些测试的过滤器。
参数 | |
---|---|
filter | String |
添加包含过滤器
public void addIncludeFilter (String filter)
添加要包含哪些测试的过滤器。
参数 | |
---|---|
filter | String |
清除排除过滤器
public void clearExcludeFilters ()
删除当前跟踪的所有排除过滤器。
清除包含过滤器
public void clearIncludeFilters ()
删除当前跟踪的所有包含过滤器。
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试,并将结果报告给侦听器。
参数 | |
---|---|
testInfo | TestInformation :包含运行测试的有用信息的TestInformation 对象。 |
listener | ITestInvocationListener : 测试结果的ITestInvocationListener |
投掷 | |
---|---|
DeviceNotAvailableException |
setCollectTestsOnly
public void setCollectTestsOnly (boolean shouldCollectTest)
启用或禁用测试收集模式
受保护的方法
检查出口代码
protectedcheckExitCode (Integer exitCode)
检查测试命令返回的退出代码。
参数 | |
---|---|
exitCode | Integer : 测试命令返回的退出代码 |
退货 | |
---|---|
可选的错误消息,如果测试退出代码指示成功则为空 |
检查测试输出
protectedcheckTestOutput (TestInformation testInfo, String actualOutputText, String outputShortName, String outputPrettyName)
检查测试命令产生的输出。
用于检查测试的标准输出和标准错误。
参数 | |
---|---|
testInfo | TestInformation :与执行的测试关联的TestInformation 对象 |
actualOutputText | String :测试产生的输出 |
outputShortName | String : 输出通道的简称 |
outputPrettyName | String :输出通道的更漂亮的名称,用于错误消息 |
退货 | |
---|---|
可选的错误消息,如果检查的输出有效则为空 |
创建测试本地临时目录
protected File createTestLocalTempDirectory (TestInformation testInfo)
在测试的依赖项文件夹中创建一个本地临时目录,以收集从被测设备中提取的测试输出。
参数 | |
---|---|
testInfo | TestInformation :与执行的测试关联的TestInformation 对象 |
退货 | |
---|---|
File | 指向创建的临时目录的ERROR(/File) 对象。 |
投掷 | |
---|---|
| 如果创建临时目录失败。 |
执行检查器测试
protectedexecuteCheckerTest (TestInformation testInfo, ITestInvocationListener listener)
执行 Checker 测试并检查其输出。
Checker 测试是一些 ART 运行测试中包含的附加测试,在测试源文件的注释中作为注释编写,用于验证 ART 的编译器。
参数 | |
---|---|
testInfo | TestInformation :与执行的测试关联的TestInformation 对象 |
listener | ITestInvocationListener :与执行的测试关联的ITestInvocationListener 对象 |
退货 | |
---|---|
可选的错误消息,如果 Checker 测试成功则为空 |
投掷 | |
---|---|
ArtRunTest.AdbShellCommandException | |
DeviceNotAvailableException |
extractSourcesFromJar 文件
protected void extractSourcesFromJar (File tmpCheckerLocalDir, File jar)
从给定的 jar 文件中提取 src 目录到给定的目录。
参数 | |
---|---|
tmpCheckerLocalDir | File |
jar | File |
getCheckerBinaryPath
protected File getCheckerBinaryPath (TestInformation testInfo)
找到 Checker 二进制文件(Python 存档)。
参数 | |
---|---|
testInfo | TestInformation |
退货 | |
---|---|
File |
运行检查器
protectedrunChecker (String[] checkerCommandLine)
运行 Checker 命令并检查其结果。
参数 | |
---|---|
checkerCommandLine | String :要执行的 Checker 命令行 |
退货 | |
---|---|
可选的错误消息,如果 Checker 调用成功则为空 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-03-30。