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
玩家是什么意思 | 剧情是什么意思 | 发烧酒精擦什么部位 | vave是什么意思 | 阑尾有什么作用 |
火加良念什么 | 山字五行属什么 | 梦见杀猪是什么意思 | sids是什么意思 | 眉心中间有痣代表什么 |
公报私仇是什么生肖 | 一笑了之是什么意思 | 易经和周易有什么区别 | 维c之王是什么水果 | aupres是什么牌子化妆品 |
尿酸高是什么原因造成的 | 饭中吃药是什么时候吃 | 痢疾是什么 | 为什么会尿酸高 | ldh是什么 |
生孩子送什么花比较好hcv9jop0ns8r.cn | 咳嗽一直不好是什么原因hcv9jop3ns2r.cn | 降血糖吃什么inbungee.com | 优格是什么hcv7jop9ns4r.cn | 手脚热吃什么药效果好hcv8jop7ns7r.cn |
猕猴桃对身体有什么好处hcv9jop2ns5r.cn | cmn是什么意思helloaicloud.com | 儿童支原体感染吃什么药hcv9jop4ns2r.cn | 口蘑不能和什么一起吃520myf.com | 小孩反复高烧是什么原因hcv9jop2ns8r.cn |
膝盖肿是什么原因96micro.com | 女生排卵期在什么时候youbangsi.com | atc是什么意思hcv8jop1ns0r.cn | 5月24日是什么星座hcv8jop1ns6r.cn | 傻白甜的意思是什么hanqikai.com |
兔死狗烹什么意思hcv7jop4ns7r.cn | 脚水泡痒用什么药hcv8jop7ns8r.cn | 七月八日是什么星座hcv8jop1ns0r.cn | ldpe是什么材料hcv8jop6ns6r.cn | 什么是国企单位youbangsi.com |