CTS 使用instrumentation命令测试
以测试CTS CAMERA为例子
1. 在android 源码下编译生成 CtsCameraTestCases.apk
mmm cts/tests/camera
2. 连接上手机, adb install CtsCameraTestCases.apk
3.在手机App info 里面赋予 APK 访问 camera 等等权限.
4.adb shell 进入手机, 运行 pm list instrumentation
255|CAP_sprout:/ # pm list instrumentation
instrumentation:android.camera.cts/androidx.test.runner.AndroidJUnitRunner (target=android.camera.cts)
instrumentation:android.camera.cts/androidx.test.runner.AndroidJUnitRunner --> CtsCameraTestCases
5.比如我们有如下 fail ,不是单项,是一个类
android.hardware.camera2.cts.FlashlightTest
若有单项fail, 需要加上具体的指定 例如: android.hardware.camera2.cts.FlashlightTest#testCameraDeviceOpenAfterTorchOn
am instrument -r -e class android.hardware.camera2.cts.FlashlightTest -w android.camera.cts/androidx.test.runner.AndroidJUnitRunner
130|CAP_sprout:/ # am instrument -r -e class android.hardware.camera2.cts.FlashlightTest -w android.camera.cts/androidx.test.runner.AndroidJUnitRunner
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=
android.hardware.camera2.cts.FlashlightTest:
INSTRUMENTATION_STATUS: test=testCameraDeviceOpenAfterTorchOn
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testCameraDeviceOpenAfterTorchOn
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testSetTorchModeOnOff
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testSetTorchModeOnOff
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=3
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testTorchCallback
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=3
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testTorchCallback
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=4
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testTorchModeExceptions
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=android.hardware.camera2.cts.FlashlightTest
INSTRUMENTATION_STATUS: current=4
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=4
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testTorchModeExceptions
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: stream=Time: 20.426OK (4 tests)INSTRUMENTATION_CODE: -1
失败就会打印出错误
android.hardware.camera2.cts.BurstCaptureRawTest:....
android.hardware.camera2.cts.BurstCaptureTest:
Error in testJpegBurst(android.hardware.camera2.cts.BurstCaptureTest):
junit.framework.AssertionFailedError: Cam 0: Exposure not locked!at junit.framework.Assert.fail(Assert.java:50)at junit.framework.Assert.assertTrue(Assert.java:20)at
命令格式:instrument [-r] [-e ] [-p ] [-w] [--user | current] [--no-window-animation] [--abi ]
Start an Instrumentation. Typically this target is in the form / or only if there is only one instrumentation. Options are: -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). Use with [-e perf true] to generate raw output for performance measurements. -e : set argument to . For test runners a common form is [-e [,...]]. -p : write profiling data to -m: Write output as protobuf (machine readable) -w: wait for instrumentation to finish before returning. Required for test runners. --user | current: Specify user instrumentation runs in; current user if not specified. --no-window-animation: turn off window animations while running. --abi : Launch the instrumented process with the selected ABI. This assumes that the process supports the selected ABI各项参数:-r:以原始形式输出测试结果;该选项通常是在性能测试时与[-e perf true]一起使用。-e name value:提供了以键值对形式存在的过滤器和参数。例如:-e testFile (运行文件中指定的用例);-e package (运行这个包中的所有用例)…… 有十几种。 -p file:将分析数据写入file。-w:测试运行器需要使用此选项。-w / :和在测试工程的AndroidManifest.xml中查找,作用是保持adb shell打开直至测试完成。--no-window-animation:运行时关闭窗口动画。--useruser_id | current:指定仪器在哪个用户中运行;如果未指定,则在当前用户中运行。
Test | Result | Details |
---|---|---|
android.hardware.camera2.cts.AllocationTest#testBlackWhite |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: wait for buffer image timed out |
android.hardware.camera2.cts.BurstCaptureTest#testJpegBurst |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Unable to get the expected capture result after waiting for 8 results |
android.hardware.camera2.cts.BurstCaptureTest#testYuvBurst |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Unable to get the expected capture result after waiting for 8 results |
android.hardware.camera2.cts.CaptureRequestTest#testAeModeAndLock |
fail |
junit.framework.AssertionFailedError: Wait for a capture result timed out in 23975ms |
android.hardware.camera2.cts.CaptureRequestTest#testDigitalZoomPreviewCombinations |
fail |
java.lang.Exception: There were 69 errors: |
android.hardware.camera2.cts.CaptureRequestTest#testDigitalZoom |
fail |
java.lang.Exception: There were 3 errors: |
android.hardware.camera2.cts.CaptureRequestTest#testNoiseReductionModeControl |
fail |
java.lang.Exception: Test failed for camera 0: Key android.noiseReduction.mode result should match request (expected = 3, actual = 2) |
android.hardware.camera2.cts.CaptureRequestTest#testEffectModes |
fail |
java.lang.Exception: Test failed for camera 0: Key android.control.effectMode result should match request (expected = 3, actual = 2) |
android.hardware.camera2.cts.PerformanceTest#testReprocessingCaptureStall |
fail |
junit.framework.AssertionFailedError: max capture stall duration should be no larger than 110.18361420000001 |
android.hardware.camera2.cts.RecordingTest#testRecordingFramerateLowToHigh |
fail |
junit.framework.AssertionFailedError: Camera 0: Video duration doesn't match: recorded 3101.000000ms, expected [1920.000000,2880.000000]ms. |
android.hardware.camera2.cts.RecordingTest#testSupportedVideoSizes |
fail |
junit.framework.AssertionFailedError: Camera 0: Video duration doesn't match: recorded 3074.000000ms, expected [1973.333252,2960.000000]ms. |
android.hardware.camera2.cts.RecordingTest#testBurstVideoSnapshot |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Timed out after 3000 ms waiting for state(s) SESSION_CLOSED |
android.hardware.camera2.cts.RecordingTest#testBasicVideoStabilizationRecording |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Timed out after 3000 ms waiting for state(s) SESSION_CLOSED |
android.hardware.camera2.cts.RecordingTest#testBasicRecording |
fail |
junit.framework.AssertionFailedError: Camera 0: Video duration doesn't match: recorded 3118.000000ms, expected [2026.666626,3040.000000]ms. |
android.hardware.camera2.cts.RecordingTest#testIntermediateSurfaceRecording |
fail |
junit.framework.AssertionFailedError: Camera 0: Video duration doesn't match: recorded 2914.000000ms, expected [960.000000,1440.000000]ms. |
android.hardware.camera2.cts.RecordingTest#testRecordingFromPersistentSurface |
fail |
junit.framework.AssertionFailedError: Camera 0: Video duration doesn't match: recorded 3049.000000ms, expected [1519.999878,2280.000000]ms. |
android.hardware.camera2.cts.RecordingTest#testVideoSnapshot |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Timed out after 3000 ms waiting for state(s) SESSION_CLOSED |
android.hardware.camera2.cts.ReprocessCaptureTest#testMixedBurstReprocessing |
fail |
junit.framework.AssertionFailedError: Wait for an image timed out in 3000ms |
android.hardware.camera2.cts.StillCaptureTest#testAePrecaptureTriggerCancelJpegCapture |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Unable to get the expected result value [2] for key android.control.aePrecaptureTrigger after waiting for 8 results |
android.hardware.camera2.cts.StillCaptureTest#testTouchForFocus |
fail |
com.android.ex.camera2.exceptions.TimeoutRuntimeException: Wait for auto focus done timed out after 6000ms |
android.hardware.camera2.cts.StillCaptureTest#testFullRawZSLCapture |
fail |
java.lang.Exception: Test failed for camera 0: Test failed for camera 0: Key android.hotPixel.mode value 1 doesn't match the expected value 2 |
android.hardware.camera2.cts.StillCaptureTest#testAeCompensation |
fail |
junit.framework.AssertionFailedError: Wait for a capture result timed out in 100ms |
android.hardware.cts.CameraGLTest#testCameraToSurfaceTextureMetadata |
fail |
java.lang.AssertionError: Too many frame intervals out of frame rate bounds: 6, limit 4 |
android.hardware.cts.CameraTest#testPreviewFpsRange |
fail |
junit.framework.AssertionFailedError: Actual fps (1.6142050040355125) should be larger than min fps (7.0) |
CTS 使用instrumentation命令测试相关推荐
- CTS(12)---android 兼容性测试 CTS 测试过程
android 兼容性测试 CTS 测试过程 写这个博客的时候是为了记忆,建议大家还是看官方的说明,官方说的很清楚,不想把官方大段大段的拷贝到这里,官方的的确说的很清楚: http://source. ...
- CTS、CTS Verify、GTS测试以及GMS认证
目录 一.一些概念 二.GMS认证 2.1 认证背景 2.2 GMS认证目的 2.3 GMS认证要求 2.4 GMS认证流程 2.5 MADA协议申请流程 三.CTS测试 3.1 CTS测试介绍 3. ...
- CTS、CTS Verify、GTS测试以及GMS认证介绍
一.一些概念 ① CTS测试 以自动化测试为基础,测试Android系统的兼容性: ② CTS Verify 一个手工测试的apk,完成自动化测试无法完成的操作(锁屏.蓝牙.摄像头等): ③ GTS ...
- 通过ping命令测试主机与虚拟机之间是否连通
一.查询本机.虚拟机Windows IP地址 1.本机的Windows IP地址 方法一:控制面板>网络和Internet>网络和共享中心>更改适配器设置>以太网>详细信 ...
- Linux系统如何测试电脑性能,如何使用DD命令测试Linux磁盘的性能?
Linux系统下DD命令是常用的命令之一,同时DD命令的使用范围也比较广泛.除了已知的可以用DD命令来复制文件外,还可以用DD命令来测试磁盘的性能.那么如何使用DD命令测试Linux磁盘的性能? 下面 ...
- iphone7测试软件,iPhone7如何测试网速 ping命令测试网速方法介绍
电脑设备测试网速的方法有很多,了解的小伙伴应该都知道那么几种.但是如果我们想要测试iPhone手机的网速,该怎么弄呢?这个估计就没有多少小伙伴知道了.下面小编来教一教大家怎么使用ping来测试网速. ...
- 使用telnet命令测试网络时连接建立后无法退出解决办法
今天,像往常一样,开通了网络策略后到服务器上使用如下命令测试网络是否连通时, telnet 198.**.**.** 8080 竟然出现了如下情况 Trying 198.**.**.**... Con ...
- linux dd 硬盘 脚本,如何使用dd命令测试Linux磁盘的读写速度
为了测试Linux磁盘的读写速度,可使用dd命令,dd命令是一个非常使用的命令,可用于文件的拷贝,下面小编就给大家介绍了如何使用dd命令测试Linux磁盘的读写速度吧. 1.先熟悉两个特殊的设备: ( ...
- java向hdfs提交命令_Java语言操作HDFS常用命令测试代码
本文主要向大家介绍了Java语言操作HDFS常用命令测试代码,通过具体的内容向大家展示,希望对大家学习JAVA语言有所帮助. package com.yxc.hdfs; import org.apac ...
- ping命令 ——测试主机间网络连通性
ping命令 --测试主机间网络连通性 一.ping命令 1.概述 2.格式 3.常用参数 4.实例 ①.检查连通性 ②.仅仅连ping 5次后停止 ③.设置ping 5 次,每次间隔0.5秒 ④.p ...
最新文章
- linux bash 学习
- python3.4.3将汉字转换为大写拼音首字母
- 配置Hyper-V Server 资源计量
- shell切割日志脚本
- TCP/IP三次握手与四次握手
- BZOJ 1003 [ZJOI2006]物流运输trans ★(Dijkstra + DP)
- MATLAB中如何取整
- 华为鸿蒙系统os新机,鸿蒙OS今日面世,华为将出新机搭载新系统入市场
- LayUI动态添加table表格
- vue前端怎么下载后端返回的二进制流excel表格文件
- Box2D 中文手册
- 共享服务中心建设原则-《企业IT架构转型之道-阿里巴巴中台战略思想与架构实战》
- 2017年年终总结 韩俊强的博客
- MATLAB中regress函数用法(多元线性回归)
- android 查看cpu 工具6,Android 之CPU监控命令
- 领航优配|累计分红超300亿元,外资持续加仓,云计算龙头再拉涨停
- live.com与live.cn邮箱收不到QQ绑定激活信的解决方法
- android mock测试资源,Android测试基础整理篇
- 红外避障模块c语言编写程序,红外避障模块(红外对管)51单片机驱动源程序
- python按键按下改变数值_【发那科】发那科机器人TP 示教器按键使用简介
热门文章
- C++程序设计:三角形图形输出
- 修改this指向的方法
- 关于光的波粒二象性的解释--答复年少时的疑惑
- DirectX11--ComPtr智能指针
- Unity 4:DirectX 11
- php k线公式源码,发个珍藏了N久的波浪主图公式(公式 指标 源码)(演示图)-其他软件公式 -程序化交易(CXH99.COM)...
- 【学习KubeEdge】
- 【疑难杂症】VScode底部状态栏不见、设置默认文件编码方式
- android手机home键,手机Home键在哪里?手机Home键是什么意思?
- 决策树模型回归可视化分析_基于Blank Friday商店销售数据分析构建回归模型