CTS入门

提要

由于项目的需要,需要跑CTS去验证新加的一些feature能不能工作, 网上搜了一些CTS环境搭建的资料,这里再总结一下。


> The Compatibility Test Suite (CTS) is a free, commercial-grade test suite, available for download. The CTS represents the "mechanism" of compatibility.

The CTS runs on a desktop machine and executes test cases directly on attached devices or an emulator. The CTS is a set of unit tests designed to be integrated into the daily workflow (such as via a continuous build system) of the engineers building a device. Its intent is to reveal incompatibilities early on, and ensure that the software remains compatible throughout the development process.

The CTS is an automated testing harness that includes two major software components:
    a. The CTS tradefed test harness runs on your desktop machine and manages test execution.
    b. Individual test cases are executed on the Device Under Test (DUT). The test cases are written in Java as JUnit tests and packaged as Android .apk files to run on the actual device target.

The Compatibility Test Suite Verifier (CTS Verifier) is a supplement to the CTS available for download. CTS Verifier provides tests for APIs and functions that cannot be tested on a stationary device without manual input (e.g. audio quality, accelerometer, etc).

The CTS Verifier is a tool for manual testing and includes the following software components:
    a. The CTS verifier app that is executed on the DUT and collects the results.
    b. The executable(s) or script(s) that are executed on the desktop machine to provide data or additional control for some test cases in the CTS Verifier app.

准备环境

1.ADB and AAPT
如果之前你已经编译了Android的image, 可以在out/host/linux-x86/bin/中找到这两个service的文件,要做的就是将他们加到环境变量里面:

export PATH=$PATH:<YOUR_ANDROID_ROOT>/out/host/linux-x86/bin/

2.JDK 要求
The master branch of Android in AOSP:
Ubuntu - OpenJDK 8, Mac OS - jdk 8u45 or newer
Android 5.x (Lollipop) - Android 6.0 (Marshmallow):
Ubuntu - OpenJDK 7, Mac OS - jdk-7u71-macosx-x64.dmg

3.CTS package 要求

AndroidCTS version
Ncts-7.0
Mcts-6.0

Run CTS的常用命令

cts-7.0 相比 cts-6.0已经做了很大的修改,已知的改动有
a. 去掉了–package 选项 (替换为-m module选项)
b. 去掉了android-cts\repository\testcases*.xml
这个改动很confuse, 因为不能再通过xml文件去过滤掉不想跑的cases, 另外也不能知道这个package包含多少个test cases,取而代之的是只能跑一遍,通过测试结果才能知道具体的cases

NM描述
-m module -t test_name-c class -m methodrun a specific test class and/or method

So, 如果想单独run android.keystore这个package包含的所有的cases, 在6.0和7.0的cts里要用不同的command:
cts-6.0

./cts-tradefed run cts --package android.keystore --disable-reboot --skip-preconditions

cts-7.0

#!/bin/sh
#set -v -x
./cts-tradefed run cts -m CtsKeystoreTestCases -disable-reboot --skip-preconditions
常用命令描述
–>l rlist results currently in the repository
–>l clist the commands currently in the queue
cts6.0–>run cts –continue-session [session-id]run all not executed tests from a previous CTS session
cts7.0–>run cts –retry [session-id]run all failed tests from a previous session

Reference:


1. Google 官网关于CTS的介绍
2. CTS package Download
3. JDK for Ubuntu LTS 14.04

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值