2024年5月16日发(作者:冀千秋)
CTS 测试使用文档
修订历史
版本
0.1
0.2
日期
2010-11-29
2011-06-06
修订人
张晓阳
任 权
说明
创建本文档
修订
一、简介
Android CTS (Compatibility Test Suite)是google提供的Android兼容性测试工具.
手机设备需要通过Android的兼容性测试(CTS),以确保在android上开发的程序在手机设备
上都能运行,才能使用android market
源码里包含cts,位置在$ANDROID/cts目录下(android2.1以后版本)
二、编译与运行CTS
编译CTS
1、下载Android-2.3系统,并编译。
$ . build/ //配置选项,并编译android源码
$ make cts //android源码编译好后,在编译cts
此时生成测试计划,测试包,测试用例,和测试报告生成的目录
Package CTS: out/host/linux-x86/cts/
cts make file: $MYDROID/build/core/tasks/
run cts program: $MYDROID/out/host/linux-x86/bin/cts
test plans: $MYDROID/out/host/linux-x86/cts/android-cts/repository/plans
test packages: $MYDROID/out/host/linux-x86/cts/android-cts/repository/testcases
test results: $MYDROID/out/host/linux-x86/cts/android-cts/repository/results
注:在运行前必须
1: #su root(切换到root权限执行,因为cts执行需要的root权限访问一些内容)
2: #. Build/
Choosecombo 1 1 5 3 //Make出完整版本
其中
1 1 5 3
指下列信息
renquan@lenovo:~/apollo$ choosecombo
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1] ------------->按enter键
Build type choices are:
1. release
2. debug
Which would you like? [1] ------------->按enter键
Product choices are:
1. core
2. full
3. generic
4. generic_x86
5. msm7630_surf
6. sdk
7. sim
You can also type the name of a product if you know it.
Which product would you like? [generic] 5 ------------->选择 5 按enter键
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng] ------------->选择3 按enter键
运行CTS
$ cd $MYDROID/out/host/linux-x86/bin/
$ ./cts
运行整个cts测试
$cts_host > start --plan CTS
测试结果在mydroid/out/host/linux-x86/cts/android-cts/repository/results 目录下,
以网页显示所有测试结果,如下图所示
三、CTS详细测试与分析
(这部分感兴趣可做代码跟踪分析,不要求)
Cts运行cts log信息部分如下:
tyTestsBase:.
Test:
Failure in testAccessParameters:
ionFailedError
at
Parameters(:560)
at
cessParameters(:508)
at Native(Native Method)
at
hod(:204)
at
$000(:36)
at
mentationTestCase$(:184)
at
mentation$(:1465)
at Callback(:587)
at chMessage(:92)
at (:123)
at (:4735)
at Native(Native Method)
at
Init$(:876)
...
Failure in testJpegThumbnailSize:
ionFailedError
at
at (:634)
at (Native Method)
egThumbnailSize(:687)
…
…
…
省略
Test results for InstrumentationTestRunner=..F....F...F..E.F..E.
Time: 33.907
FAILURES!!!
Tests run: 21, Failures: 6, Errors: 2
Cts提供了测试的源代码
比如camera,测试代码位于
#/home/xiaoyang/workcode/master-lephone-plat/cts/tests/tests/hardware/src/andro
id/hardware/cts
Camera_ParametersTest
…
根据测试log信息,
assertParameters(:560)
找到源文件代码报错位置
在测试代码中
打开LOGV开关
Log.v(TAG, "xxxxxxxx");
加入调试信息
在代码中加入调试信息,同时可以再打开其它窗口运行logcat/dmesg查看其它
信息来定位:
$ ./adb shell logcat –V time
抓dmesg log
$ ./adb shell dmesg 或者 $cat proc/kmsg
查看用户空间信息
四、Q/A
Question:运行不正常
xiaoyang@xiaoyang-desktop:~/workcode/master-lephone-plat/out/host/linux-x86/bin$ ./cts
Android CTS version 2.2_r1
Device(1234567890ABCDEF) connected
cts_host > cts_host > start --plan CTS
Exception in thread "Timer-0" interException
at vice$(:1019)
at op(:512)
at (:462)
start test plan CTS
CTS_INFO >>>
CTS_INFO >>> This might take several minutes, please
uninstall met failure
API Check TIMEOUT.
(timeout)
CTS_INFO >>> Max ADB operations reached.
CTS_INFO >>> Restarting device ...
Device(1234567890ABCDEF) disconnected
原因:用户权限
解决方法:在host上运行手机设备调试,
转为root权限执行./cts
2024年5月16日发(作者:冀千秋)
CTS 测试使用文档
修订历史
版本
0.1
0.2
日期
2010-11-29
2011-06-06
修订人
张晓阳
任 权
说明
创建本文档
修订
一、简介
Android CTS (Compatibility Test Suite)是google提供的Android兼容性测试工具.
手机设备需要通过Android的兼容性测试(CTS),以确保在android上开发的程序在手机设备
上都能运行,才能使用android market
源码里包含cts,位置在$ANDROID/cts目录下(android2.1以后版本)
二、编译与运行CTS
编译CTS
1、下载Android-2.3系统,并编译。
$ . build/ //配置选项,并编译android源码
$ make cts //android源码编译好后,在编译cts
此时生成测试计划,测试包,测试用例,和测试报告生成的目录
Package CTS: out/host/linux-x86/cts/
cts make file: $MYDROID/build/core/tasks/
run cts program: $MYDROID/out/host/linux-x86/bin/cts
test plans: $MYDROID/out/host/linux-x86/cts/android-cts/repository/plans
test packages: $MYDROID/out/host/linux-x86/cts/android-cts/repository/testcases
test results: $MYDROID/out/host/linux-x86/cts/android-cts/repository/results
注:在运行前必须
1: #su root(切换到root权限执行,因为cts执行需要的root权限访问一些内容)
2: #. Build/
Choosecombo 1 1 5 3 //Make出完整版本
其中
1 1 5 3
指下列信息
renquan@lenovo:~/apollo$ choosecombo
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1] ------------->按enter键
Build type choices are:
1. release
2. debug
Which would you like? [1] ------------->按enter键
Product choices are:
1. core
2. full
3. generic
4. generic_x86
5. msm7630_surf
6. sdk
7. sim
You can also type the name of a product if you know it.
Which product would you like? [generic] 5 ------------->选择 5 按enter键
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng] ------------->选择3 按enter键
运行CTS
$ cd $MYDROID/out/host/linux-x86/bin/
$ ./cts
运行整个cts测试
$cts_host > start --plan CTS
测试结果在mydroid/out/host/linux-x86/cts/android-cts/repository/results 目录下,
以网页显示所有测试结果,如下图所示
三、CTS详细测试与分析
(这部分感兴趣可做代码跟踪分析,不要求)
Cts运行cts log信息部分如下:
tyTestsBase:.
Test:
Failure in testAccessParameters:
ionFailedError
at
Parameters(:560)
at
cessParameters(:508)
at Native(Native Method)
at
hod(:204)
at
$000(:36)
at
mentationTestCase$(:184)
at
mentation$(:1465)
at Callback(:587)
at chMessage(:92)
at (:123)
at (:4735)
at Native(Native Method)
at
Init$(:876)
...
Failure in testJpegThumbnailSize:
ionFailedError
at
at (:634)
at (Native Method)
egThumbnailSize(:687)
…
…
…
省略
Test results for InstrumentationTestRunner=..F....F...F..E.F..E.
Time: 33.907
FAILURES!!!
Tests run: 21, Failures: 6, Errors: 2
Cts提供了测试的源代码
比如camera,测试代码位于
#/home/xiaoyang/workcode/master-lephone-plat/cts/tests/tests/hardware/src/andro
id/hardware/cts
Camera_ParametersTest
…
根据测试log信息,
assertParameters(:560)
找到源文件代码报错位置
在测试代码中
打开LOGV开关
Log.v(TAG, "xxxxxxxx");
加入调试信息
在代码中加入调试信息,同时可以再打开其它窗口运行logcat/dmesg查看其它
信息来定位:
$ ./adb shell logcat –V time
抓dmesg log
$ ./adb shell dmesg 或者 $cat proc/kmsg
查看用户空间信息
四、Q/A
Question:运行不正常
xiaoyang@xiaoyang-desktop:~/workcode/master-lephone-plat/out/host/linux-x86/bin$ ./cts
Android CTS version 2.2_r1
Device(1234567890ABCDEF) connected
cts_host > cts_host > start --plan CTS
Exception in thread "Timer-0" interException
at vice$(:1019)
at op(:512)
at (:462)
start test plan CTS
CTS_INFO >>>
CTS_INFO >>> This might take several minutes, please
uninstall met failure
API Check TIMEOUT.
(timeout)
CTS_INFO >>> Max ADB operations reached.
CTS_INFO >>> Restarting device ...
Device(1234567890ABCDEF) disconnected
原因:用户权限
解决方法:在host上运行手机设备调试,
转为root权限执行./cts