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
黑洞是什么 | 吃什么大便能特别通畅 | 退役和退伍有什么区别 | 什么是六爻 | 喜欢是什么 |
霍金是什么病 | 天蝎座是什么星座 | 是什么符号 | 拔牙有什么危害 | 顾名思义的顾什么意思 |
日食是什么现象 | 榻榻米是什么 | 主理人什么意思 | 做梦梦到蜘蛛是什么意思 | 脉细滑是什么意思 |
牙齿松动是什么原因引起的 | 什么水果下火 | 看破红尘下一句是什么 | 吃什么补维生素a | noon是什么意思 |
眼睛不舒服是什么原因引起的hcv8jop9ns8r.cn | 棉花是什么时候传入中国的chuanglingweilai.com | 移动增值业务费是什么xinmaowt.com | 8月28号是什么星座hcv7jop7ns3r.cn | 华丽的什么hcv8jop5ns2r.cn |
为什么会气虚hcv9jop4ns5r.cn | 3月27日是什么星座hcv8jop8ns1r.cn | 额窦炎吃什么药管用hcv8jop0ns5r.cn | 屁股里面疼是什么原因hcv7jop5ns6r.cn | 心阳不足吃什么中成药hcv8jop1ns2r.cn |
胰腺炎吃什么药好hcv8jop5ns8r.cn | 处女座上升星座是什么hcv7jop9ns5r.cn | 右眼皮一直跳是什么原因mmeoe.com | 为什么晚上不能扫地weuuu.com | 球蛋白偏高是什么意思hcv9jop6ns1r.cn |
什么的关系wzqsfys.com | vibe什么意思inbungee.com | 梦见自己流产了是什么征兆hlguo.com | 为什么突然得了荨麻疹jasonfriends.com | 甘蔗什么时候成熟hcv9jop3ns8r.cn |