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

Android 运行CTS和VTS测试计划的正确命令是什么?,android,cts,android-cts,android-vts,android-tradefederation,Android,Cts,Android Cts,Android Vts,Android Tradefederation,我将为我们的AOSP设置VTS和CTS测试。这两个测试套件都使用贸易联盟测试框架。让我困惑的是如何运行不同的测试计划 根据VTS的文档(),必须决定运行哪个测试计划。然后使用run命令对其进行测试 例如,如果我想运行默认的VTS测试计划,我会使用它来运行它 me@computer> vts-tradefed vts-tf > run vts 这将对连接的设备启动一系列测试 接下来,在启动CTS测试时,我希望调用相应的函数,或者看起来是什么。按照以下说明,我希望使用名为“CTS”的测

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

根据VTS的文档(),必须决定运行哪个测试计划。然后使用run命令对其进行测试

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

me@computer> vts-tradefed
vts-tf > run vts
这将对连接的设备启动一系列测试

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

这似乎工作正常,测试似乎开始了。但是我在CTS()的手册中读到,CTS应该作为
运行CTS--plan
执行。他们给出了下面的示例
runcts--plan cts
来运行默认的cts计划

通过附加:run cts--plan cts启动默认测试计划(包含所有测试包)。这将启动所需的所有CTS测试 为了兼容性

对于CTS v1(Android 6.0及更早版本),输入list plans可查看存储库中的测试计划列表,或输入list packages可查看列表 存储库中测试包的数量。 对于CTS v2(Android 7.0及更高版本),输入list modules以查看测试模块列表

或者,使用:CTS tradefed run CTS--plan从命令行运行您选择的CTS计划

在测试时,它似乎也能工作。两个想法让我感到疑惑。首先,示例中的测试计划用大写字母表示,即“CTS”而不是“CTS”。其次,run命令在这里的工作方式似乎完全不同。对我来说,
run
-命令是一个内置的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
vts tf>帮助运行
r(?:un)?帮助:
命令[选项]运行指定的命令
[选项]上面的快捷方式:运行指定的命令
cmdfile运行指定的commandfile
commandexit[options]运行指定的命令,然后立即运行“exit-c”
cmdfileAndExit运行指定的commandfile,然后立即运行“exit-c”
-----供应商测试套件特定选项------
--module/-m运行测试模块
--module/-m--test/-t从模块运行特定的测试。测试名称可以是.、.#或
可用选项:
--serial/-s:在其上运行测试的设备
--abi/-a:运行测试的abi
--失败时的logcat:测试失败时捕获logcat
--失败时的bugreport:在测试失败时捕获bugreport
--失败截图:在测试失败时捕获截图
--分片计数:分片运行到给定数量的独立块中,在多个设备上并行运行。
-----为了重试上一次运行-----
重试--重试[--重试类型]
如果没有--retry类型,retry将运行失败测试和未执行测试
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
cts-tf>帮助运行
r(?:un)?帮助:
命令[选项]运行指定的命令
[选项]上面的快捷方式:运行指定的命令
cmdfile运行指定的commandfile
commandexit[options]运行指定的命令,然后立即运行“exit-c”
cmdfileAndExit运行指定的commandfile,然后立即运行“exit-c”
-----兼容性测试套件特定选项------
--module/-m运行测试模块
--module/-m--test/-t从模块运行特定的测试。测试名称可以是.、.#或
可用选项:
--serial/-s:在其上运行测试的设备
--abi/-a:运行测试的abi
--失败时的logcat:测试失败时捕获logcat
--失败时的bugreport:在测试失败时捕获bugreport
--失败截图:在测试失败时捕获截图
--分片计数:分片运行到给定数量的独立块中,在多个设备上并行运行。
-----为了重试上一次运行-----
重试--重试[--重试类型]
如果没有--retry类型,retry将运行失败测试和未执行测试
这些解释几乎完全相同。因此,使用
runcts
runvts
分别运行实际上是有意义的。这只是一个愚蠢的问题,我完全错了吗?由于这些测试对我们的兼容性非常重要,我希望确保它们以正确的方式运行。

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

要运行完整的vts或cts测试:
运行
例如运行cts/运行vts

在计划中运行特定模块:
run-m
例如运行cts-m CtsMyDisplayTestCases(模块名称应与Android.mk中的本地包名称相同)

运行包含计划中特定模块的多个测试的特定测试类:
运行-m-t
例如运行cts-m CtsMyDisplayTestCases-t android.display.cts.ScreenTests(此命令将运行测试类'ScreenTests'中的所有测试,包名与AndroidManifest.xml中的固定名称相同)

在计划中特定模块的测试类中运行特定测试用例:
运行-m-t
例如运行cts-m CtsMyDisplayTestCases-t android.display.cts.ScreenTests#testDisplayName(此命令将运行测试类'ScreenTests'中存在的testDisplayName测试用例),包名与AndroidManifest.xml中的固定名称相同
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