These are instructions for collecting code coverage data for android instrumentation and JUnit tests. For Clang(C++) code coverage refer to clang coverage.
In order to use JaCoCo code coverage, we need to create build time pre-instrumented class files and runtime .exec files. Then we need to process them using the build/android/generate_jacoco_report.py script.
target_os = "android" use_jacoco_coverage = true
Now when building, pre-instrumented files will be created in the build directory.
Run tests, with option --coverage-dir <directory>
, to specify where to save the .exec file. For example, you can run chrome JUnit tests: out/Debug/bin/run_chrome_junit_tests --coverage-dir /tmp/coverage
.
The coverage results of JUnit and instrumentation tests will be merged automatically if they are in the same directory.
generate_jacoco_report.py
, for example:build/android/generate_jacoco_report.py \ --format html \ --output-dir /tmp/coverage_report/ \ --coverage-dir /tmp/coverage/ \ --sources-json-dir out/Debug/ \
Then an index.html containing coverage info will be created in output directory:
[INFO] Loading execution data file /tmp/coverage/testTitle.exec. [INFO] Loading execution data file /tmp/coverage/testSelected.exec. [INFO] Loading execution data file /tmp/coverage/testClickToSelect.exec. [INFO] Loading execution data file /tmp/coverage/testClickToClose.exec. [INFO] Loading execution data file /tmp/coverage/testThumbnail.exec. [INFO] Analyzing 58 classes.
--output-file
instead of --output-dir
since only one file will be generated as XML or CSV report.build/android/generate_jacoco_report.py \ --format xml \ --output-file /tmp/coverage_report/report.xml \ --coverage-dir /tmp/coverage/ \ --sources-json-dir out/Debug/ \
or
build/android/generate_jacoco_report.py \ --format csv \ --output-file /tmp/coverage_report/report.csv \ --coverage-dir /tmp/coverage/ \ --sources-json-dir out/Debug/ \
--include-substr-filter
option to choose jars in the desired directory. Eg. for generating coverage report for Clank internal repobuild/android/generate_jacoco_report.py --format html \ --output-dir /tmp/coverage_report/ --coverage-dir /tmp/coverage/ \ --sources-json-dir out/java_coverage/ \ --include-substr-filter obj/clank
梦见买肉是什么意思 | 乳头有点痒是什么原因 | 皮肤起小水泡很痒是什么原因 | 为盼是什么意思 | 感叹是什么意思 |
大姨妈期间可以吃什么水果 | 救世主是什么意思 | l1椎体在什么位置 | 耳鸣需要做什么检查 | 什么叫有机 |
胃部检查除了胃镜还有什么方法 | 牙周炎用什么药最见效 | 小孩流鼻血是什么原因 | 相招是什么意思 | 粉墙用什么 |
阴阳和合是什么意思 | nary是什么牌子的手表 | 倒灌是什么意思 | 梦到怀孕生孩子是什么意思 | ie是什么 |
有机物是什么xscnpatent.com | 解落三秋叶的解是什么意思hcv9jop7ns9r.cn | 打边炉是什么意思hcv7jop9ns4r.cn | 什么是肺腺癌hcv9jop5ns8r.cn | 拉屎出血是什么原因hcv8jop6ns0r.cn |
九月三号是什么日子hcv7jop9ns8r.cn | 鼻窦炎是什么样子的hcv8jop3ns1r.cn | 取保候审需要什么条件baiqunet.com | 轻度脑梗吃什么药最好hcv9jop2ns8r.cn | 五味是什么hcv8jop9ns4r.cn |
脚踝肿是什么原因引起的hcv8jop3ns5r.cn | 不尽人意是什么意思hcv8jop1ns4r.cn | 腹部彩超能查出什么hcv8jop5ns7r.cn | 办理住院手续需要带什么证件ff14chat.com | 为什么叫印度阿三xianpinbao.com |
看心脏挂什么科hcv9jop3ns6r.cn | 中午12点半是什么时辰hcv9jop0ns1r.cn | 三月初什么星座hanqikai.com | 马超是什么生肖hcv7jop9ns9r.cn | 什么的风儿hcv8jop2ns0r.cn |