【OpenHarmony】TDD-FUZZ环境配置

零、参考

1、AttributeError: 'ElementTree' object has no attribute 'getiterator':https://blog.csdn.net/suhao0911/article/details/110950742

一、创建工作目录

1、新建工作目录如:D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz。

2、gitee上下载 testfwk_developer_test-master、testfwk_xdevice-master。

3、将developer_test、xdevice压缩包解压到 D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz,并且目录重命名为developer_test、xdevice(必须重命名为xdevice)

https://gitee.com/openharmony/testfwk_xdevice/blob/master/config/user_config.xml

二、创建测试套目录 tests

在工作目录D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz下创建目录 tests用于存放 tdd、fuzz用例。

配置D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\developer_test\config\usr_config.xml(指定test_cases为D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\tests

三、下载TDD、FUZZ测试套

tdd、fuzz用例从版本里取构建详情 (openharmony.cn) :http://ci.openharmony.cn/workbench/cicd/dailybuild/detail/component

四、执行TDD、FUZZ测试

常用TDD测试命令

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_native_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_02

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_04

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window

TDD执行

run -t UT

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

FUZZ执行

run -t FUZZ

run -t FUZZ -ts PlayerStubFuzzTest

run -t FUZZ -ts PlayerStubFuzzTest -tc xxxxx.xxxx

问题1、exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'

Python版本问题(3.9 删除了getiterator接口,变成了iter):

2023-08-31 10:14:01,189\] \[196804\] \[Concurrent\] \[ERROR\] \[Device: 150100424a\*\*\*\*\*\*\*\*\*\*\*\*834bfb4900, exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'\] \[ErrorNo=00000

2023-08-31 10:14:01,190\] \[196804\] \[Concurrent\] \[INFO\] \[Executed: D:\\0000_TDD_FUZZ\\0000_ohos_tdd_fuzz\\tests\\fuzztest\\player_framework\\recorder\\RecorderSetVideoSizeFuzzTest, Execution Time: 2sec

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

相关推荐
雪域迷影16 小时前
OpenHarmony之电源模式定制开发指导
openharmony·电源模式
智驾2 天前
Openharmony 和 HarmonyOS 区别?
harmonyos·openharmony
TARDIS_20204 天前
OpenHarmony-Risc-V上运行openBLAS中的benchmark
risc-v·openharmony
少年的云河月5 天前
OpenHarmony Camera开发指导(五):相机预览功能(ArkTS)
harmonyos·openharmony·camera·相机开发
少年的云河月8 天前
OpenHarmony Camera开发指导(四):相机会话管理(ArkTS)
harmonyos·相机·openharmony·camera
Thomas_YXQ9 天前
Unity3D 测试驱动开发(TDD)框架设计
java·开发语言·驱动开发·全文检索·unity3d·lucene·tdd
古月居GYH9 天前
嵌入式C语言高级编程:OOP封装、TDD测试与防御性编程实践
c语言·开发语言·tdd
夜星辰202310 天前
最新 OpenHarmony 系统一二级目录整理
openharmony
ursamjnor12 天前
基于 OpenHarmony 5.0 的星闪轻量型设备应用开发-Ch1 开发环境搭建
openharmony·星闪·轻量型设备开发
少年的云河月12 天前
OpenHarmony Camera组件简介
harmonyos·相机·openharmony·camera