运行 CTS 和 VTS 测试计划的正确命令是什么?



我即将为我们的AOSP设置VTS和CTS测试。这两个测试套件都使用贸易联盟测试框架。让我感到困惑的是,如何运行不同的测试计划。

根据VTS的文档(https://source.android.com/compatibility/vts/systems(,必须决定运行哪个测试计划。然后使用 run 命令对其进行测试。

例如,如果我想运行默认的VTS测试计划,我会使用它。

me@computer> vts-tradefed
vts-tf > run vts

这将对连接的设备启动许多测试。

接下来,在启动 CTS 测试时,我希望调用相应的函数,或者看起来是什么。通过以下说明,我希望使用名为"cts"的测试计划运行 CTS 测试。

me@computer> cts-tradefed
cts-tf > run cts

这似乎工作正常,测试似乎开始了。但后来我在 CTS 的手册中读到(https://source.android.com/compatibility/cts/run(,CTS 应按run cts --plan <test-plan>执行。他们给出了以下示例run cts --plan CTS以运行默认的 cts 计划。

通过附加以下内容启动默认测试计划(包含所有测试包(:运行 CTS --plan CTS。这将启动所有所需的 CTS 测试 为了兼容性。

对于 CTS v1(Android 6.0 及更低版本(,请输入列表计划以查看存储库中的测试计划列表,或输入列表包以查看列表 存储库中的测试包。 对于 CTS v2(Android 7.0 及更高版本(,请输入列表模块以查看测试模块列表。

或者,使用以下命令从命令行运行您选择的 CTS 计划: CTS 交易运行 CTS --计划

在测试它时,它似乎也可以工作。两个想法让我感到疑惑。首先,示例中的测试计划用大写字母引用,即"CTS"而不是"CTS"。其次,运行命令在这里的工作方式似乎完全不同。对我来说,run-command是一个内置的tradefeed命令是有道理的,它的参数应该是测试计划的名称。贸易本身也证实了这一点。

VTS 帮助:

vts-tf > help run
r(?:un)? help:
command <config> [options]        Run the specified command
<config> [options]                Shortcut for the above: run specified command
cmdfile <cmdfile.txt>             Run the specified commandfile
commandAndExit <config> [options] Run the specified command, and run 'exit -c' immediately afterward
cmdfileAndExit <cmdfile.txt>      Run the specified commandfile, and run 'exit -c' immediately afterward
----- Vendor Test Suite specific options ----- 
<plan> --module/-m <module>       Run a test module
<plan> --module/-m <module> --test/-t <test_name>    Run a specific test from the module. Test name can be <package>.<class>, <package>.<class>#<method> or <native_binary_name>
Available Options:
--serial/-s <device_id>: The device to run the test on
--abi/-a <abi>         : The ABI to run the test against
--logcat-on-failure    : Capture logcat when a test fails
--bugreport-on-failure : Capture a bugreport when a test fails
--screenshot-on-failure: Capture a screenshot when a test fails
--shard-count <shards>: Shards a run into the given number of independent chunks, to run on multiple devices in parallel.
----- In order to retry a previous run -----
retry --retry <session id to retry> [--retry-type <FAILED | NOT_EXECUTED>]
Without --retry-type, retry will run both FAIL and NOT_EXECUTED tests

CTS 帮助:

cts-tf > help run
r(?:un)? help:
command <config> [options]        Run the specified command
<config> [options]                Shortcut for the above: run specified command
cmdfile <cmdfile.txt>             Run the specified commandfile
commandAndExit <config> [options] Run the specified command, and run 'exit -c' immediately afterward
cmdfileAndExit <cmdfile.txt>      Run the specified commandfile, and run 'exit -c' immediately afterward
----- Compatibility Test Suite specific options ----- 
<plan> --module/-m <module>       Run a test module
<plan> --module/-m <module> --test/-t <test_name>    Run a specific test from the module. Test name can be <package>.<class>, <package>.<class>#<method> or <native_binary_name>
Available Options:
--serial/-s <device_id>: The device to run the test on
--abi/-a <abi>         : The ABI to run the test against
--logcat-on-failure    : Capture logcat when a test fails
--bugreport-on-failure : Capture a bugreport when a test fails
--screenshot-on-failure: Capture a screenshot when a test fails
--shard-count <shards>: Shards a run into the given number of independent chunks, to run on multiple devices in parallel.
----- In order to retry a previous run -----
retry --retry <session id to retry> [--retry-type <FAILED | NOT_EXECUTED>]
Without --retry-type, retry will run both FAIL and NOT_EXECUTED tests

解释几乎相同。因此,与run cts一起运行并重复run vts实际上是有意义的。这只是一个愚蠢的问题,我完全错了吗?由于这些测试对于我们的兼容性很重要,我希望确保它们以正确的方式运行。

要运行计划(cts 或 vts(,您可以根据选择性使用不同的命令:

要运行完整的 vts 或 cts 测试:run <plan>例如运行cts/运行 vts

要在计划中运行特定模块:run <plan> -m <module>例如运行 cts -m CtsMyDisplayTestCases(模块名称应与 Android.mk 中存在的LOCAL_PACAKGE_NAME中提到的相同(

要运行包含计划中特定模块的多个测试的特定测试类:run <plan> -m <module> -t <packageName.className>例如运行 cts -m CtsMyDisplayTestCases -t android.display.cts.ScreenTests(此命令将运行测试类"ScreenTests"中存在的所有测试,包名称与 AndroidManifest 中修复的名称相同.xml(

要在计划中特定模块的测试类中运行特定测试用例:run <plan> -m <module> -t <packageName.className#testName>例如运行 cts -m CtsMyDisplayTestCases -t android.display.cts.ScreenTests#testDisplayName(此命令将运行测试类"ScreenTests"中存在的 testDisplayName 测试用例,包名称与 AndroidManifest.xml 中修复的相同(

您还可以查看 AOSP/cts/目录以了解命名约定和工作的基本概念。

最新更新