我即将为我们的 AOSP 设置 VTS 和 CTS 测试。两个测试套件都使用 Trade Federation 测试框架。令我困惑的是如何运行不同的测试计划。
根据 VTS 的文档 ( https://source.android.com/compatibility/vts/systems ),必须决定运行哪个测试计划。然后使用运行命令对其进行测试。
例如,如果我想运行默认的 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 计划。
通过附加以下命令启动默认测试计划(包含所有测试包): run cts --plan CTS 。这将启动兼容性所需的所有 CTS 测试。
对于 CTS v1(Android 6.0 及更早版本),输入 list plan 以查看存储库中的测试计划列表,或输入 list packages 以查看存储库中的测试包列表。对于 CTS v2(Android 7.0 及更高版本),输入 list modules 以查看测试模块列表。
或者,使用以下命令从命令行运行您选择的 CTS 计划:cts-tradefed run cts --plan
在测试时,它似乎也可以工作。两个想法让我想知道。首先,示例中的测试计划用大写字母表示,即“CTS”而不是“cts”。其次,运行命令在这里的工作方式似乎完全不同。对我来说,run
-command 是一个内置的 tradefed 命令是有道理的,它的参数应该是测试计划的名称。tradefed 本身也证实了这一点。
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
。这只是一个愚蠢的问题,我完全错了吗?由于这些测试对我们的兼容性很重要,我希望确保它们以正确的方式运行。