| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| README.md | D | 12-May-2024 | 2.9 KiB | 53 | 49 | |
| binder_filter_test.cpp | D | 12-May-2024 | 12.3 KiB | 292 | 220 | |
| bio_parser_test.cpp | D | 12-May-2024 | 15.7 KiB | 318 | 278 | |
| bytrace_parser_test.cpp | D | 12-May-2024 | 8.8 KiB | 245 | 166 | |
| clock_filter_test.cpp | D | 12-May-2024 | 19.3 KiB | 508 | 372 | |
| cpu_filter_test.cpp | D | 12-May-2024 | 14.9 KiB | 353 | 229 | |
| ebpf_file_system_test.cpp | D | 12-May-2024 | 23.9 KiB | 511 | 418 | |
| ebpf_parser_test.cpp | D | 12-May-2024 | 6 KiB | 160 | 104 | |
| event_parser_test.cpp | D | 12-May-2024 | 43.4 KiB | 1,204 | 801 | |
| filter_filter_test.cpp | D | 12-May-2024 | 2.8 KiB | 86 | 47 | |
| hidump_parser_test.cpp | D | 12-May-2024 | 5.3 KiB | 161 | 109 | |
| hilog_parser_test.cpp | D | 12-May-2024 | 13.9 KiB | 359 | 265 | |
| hisys_event_parser_test.cpp | D | 12-May-2024 | 8.4 KiB | 185 | 150 | |
| htrace_binder_event_test.cpp | D | 12-May-2024 | 20.1 KiB | 515 | 410 | |
| htrace_cpu_data_parser_test.cpp | D | 12-May-2024 | 11.6 KiB | 313 | 224 | |
| htrace_cpu_detail_parser_test.cpp | D | 12-May-2024 | 5.4 KiB | 156 | 109 | |
| htrace_diskio_parser_test.cpp | D | 12-May-2024 | 12.5 KiB | 330 | 242 | |
| htrace_event_parser_test.cpp | D | 12-May-2024 | 22.3 KiB | 633 | 444 | |
| htrace_irq_event_test.cpp | D | 12-May-2024 | 18.4 KiB | 513 | 394 | |
| htrace_mem_parser_test.cpp | D | 12-May-2024 | 9 KiB | 257 | 180 | |
| htrace_network_parser_test.cpp | D | 12-May-2024 | 12.4 KiB | 300 | 236 | |
| htrace_process_parser_test.cpp | D | 12-May-2024 | 11.6 KiB | 299 | 224 | |
| htrace_sys_mem_parser_test.cpp | D | 12-May-2024 | 9.6 KiB | 277 | 197 | |
| htrace_sys_vmem_parser_test.cpp | D | 12-May-2024 | 9.6 KiB | 276 | 195 | |
| http_server_test.cpp | D | 12-May-2024 | 9.9 KiB | 348 | 267 | |
| irq_filter_test.cpp | D | 12-May-2024 | 12.3 KiB | 343 | 240 | |
| measure_filter_test.cpp | D | 12-May-2024 | 13.5 KiB | 334 | 218 | |
| native_hook_parser_test.cpp | D | 12-May-2024 | 87 KiB | 1,913 | 1,464 | |
| paged_memory_parser_test.cpp | D | 12-May-2024 | 14.8 KiB | 290 | 246 | |
| parser_test.cpp | D | 12-May-2024 | 11 KiB | 322 | 265 | |
| process_filter_test.cpp | D | 12-May-2024 | 13.4 KiB | 386 | 248 | |
| rpc_server_test.cpp | D | 12-May-2024 | 2.7 KiB | 88 | 56 | |
| slice_filter_test.cpp | D | 12-May-2024 | 18.7 KiB | 415 | 296 | |
| smaps_parser_test.cpp | D | 12-May-2024 | 11.2 KiB | 287 | 217 | |
| span_join_test.cpp | D | 12-May-2024 | 10.4 KiB | 246 | 205 | |
| table_test.cpp | D | 12-May-2024 | 60.3 KiB | 1,492 | 1,165 | |
| wasm_func_test.cpp | D | 12-May-2024 | 2.6 KiB | 85 | 52 |
README.md
1# 准备测试的硬件环境 2 1. 测试依赖hi3516DV300设备。 3 2. 烧录OHOS_STD代码。 4 3. 通过直连方式,使用USB线将设备连接到存储测试代码的主机。 5 6# 准备测试的软件环境 7 1. 设置UT环境变量 8 在代码根目录执行:export BUILD_UT=true 9 2. 连接设备 10 在代码根目录执行: root 11 remount 12 3. 准备UT依赖的动态库 13 通过push 把测试依赖的libsqlite.z.so等动态库推到hi3516DV300设备的system/lib文件夹下。 14 4. 准备UT依赖的资源文件 15 将OHOS_STD/test/resource目录push到hi3516DV300设备的/data目录 16 在代码根目录执行: push ./test/resource/ /data/ 17 5. 环境清理 18 (a) 执行之前先清理OHOS_STD/out/xxx-arm-release/obj/developtools 临时文件。 19 rm -rf ~/OHOS_STD/out/xxx-arm-release/obj/developtools 20 (b) 清理hi3516DV300设备上生成的中间文件/home/XXX/OHOS_STD/out。 21 rm -rf /home/ohos/OHOS_STD/out* 22 (c) 清理UT环境残留的覆盖率报告。 23 rm -rf ~/OHOS_STD/developtools/profiler/build/html 24 25# 测试步骤 26 1. 启动UT执行环境, 启动后根据提示信息输入hi3516DV300对应的设备编号。 27 在代码根目录执行:./test/developertest/start.sh 28 2. 编译并执行hiprofiler_ts_ut。 29 在start.sh启动的交互式窗口执行:run -t ut -ss developtools -ts hiprofiler_ts_ut 30 31# 生成测试报告 32 1. pull设备上生成的gcda 33 进入设备环境后: 执行cd /home/XXX/OHOS_STD 34 tar -cvf out.tar out 35 exit 36 退出shell后:pull /home/XXX/OHOS_STD/out.tar ~/OHOS_STD/ 37 tar -xvf out.tar 38 pull /home/ohos/OHOS_STD/out/* /home/ohos/OHOS_STD/out/ 39 cd /home/ohos/OHOS_STD/developtools/profiler/build 40 2. 生成UT覆盖率报告 41 在代码根目录执行:./developtools/profiler/build/lcov.sh 42 pull /data/test/hiprofiler_ts_ut.xml ~/OHOS_STD/developtools/profiler/build/html/ 43 报告位置:~/OHOS_STD/developtools/profiler/build/html/index.html 44 45# 可能遇到的问题 46 1. gcno文件不存在问题 47 gcno文件是在编译阶段生成,编译时如果out目录存在.o临时文件,则不会编译源码,需要删除out/ obj/developtools/目录的编译中间文件后重新编译 48 2. 运行时报缺少依赖库libsqlite.z.so 49 需要把libsqlite.z.so push到设备的system/lib目录,在developtools/profiler/device/ohos_test.xml文件增加push命令 50 3. UT所有步骤执行完之后,html中没有生成覆盖率信息 51 权限问题,从设备中pull出来gcov文件后,需要关注文件权限 52 4. UT输出覆盖率世间点不是当前最新时间 53 清理掉原来的html文件,重新执行lcov.sh,生成新的html覆盖率报告