Questions about Native code coverage of Chromium for Android

63 views
Skip to first unread message

Junyi Huang

unread,
Jun 27, 2018, 3:38:37 AM6/27/18
to code-c...@chromium.org
Hi, code-coverage team @ chromium,

First of all, I want to thank you for the coverage measurement script coverage.py, it works great! It helps me to know about the tests and how much it covers. Since I'm an Android developer, I'm looking for the coverage report for Chromium for Android. It's a pity that coverage.py doesn't support Android target os. I know Chromium support emma coverage tool for java tests, so junit tests and instrumentation tests coverage could be measured. As for gtest, is there way to measure the coverage? I checked the arguments for GN files and in the tools, and I found it has some coverage measuring tools for c++ tests like gcov in v8, but I'm confused about how to use it. Also, I tried to do the steps separately in coverage.py to generate the coverage report, but the build of native tests failed when  use_clang_coverage = true is_compoenent_build = false. The failure information are like:

chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/lib/linux/libclang_rt.profile-arm-android.a: No such file or directory 

Is clang_coverage tool are not capable for Android native test?

What's more, I checked the usage of lcov, it asks enabling coverage when compile c/c++ source code. But the tests are built through ninja, seems not possible to enable the compile settings at the ninja -C  build command. I'm really confused about is there any way to measure the coverage of native tests?

Thank you for reply!

All best,

Jennifer

Inferno

unread,
Jun 27, 2018, 10:28:58 AM6/27/18
to jh2...@cornell.edu, code-c...@chromium.org
Android is currently not a supported platform for coverage.py (patches welcome if can make it work). We have a tracking issue for this - https://bugs.chromium.org/p/chromium/issues/detail?id=843356
 

Thank you for reply!

All best,

Jennifer

--
You received this message because you are subscribed to the Google Groups "code-coverage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to code-coverag...@chromium.org.
To post to this group, send email to code-c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/code-coverage/CALA%3Dg36OXsG%2BgVsPqk08VpgUSxRFkid4u%3DUDP2OJwkHvtvsWbA%40mail.gmail.com.

Max Moroz

unread,
Jul 13, 2018, 1:08:06 PM7/13/18
to jh2...@cornell.edu, code-c...@chromium.org
On Wed, Jun 27, 2018 at 12:38 AM Junyi Huang <jh2...@cornell.edu> wrote:
Hi, code-coverage team @ chromium,

First of all, I want to thank you for the coverage measurement script coverage.py, it works great! It helps me to know about the tests and how much it covers.

Thanks for the feedback!
 
Since I'm an Android developer, I'm looking for the coverage report for Chromium for Android. It's a pity that coverage.py doesn't support Android target os. I know Chromium support emma coverage tool for java tests, so junit tests and instrumentation tests coverage could be measured. As for gtest, is there way to measure the coverage? I checked the arguments for GN files and in the tools, and I found it has some coverage measuring tools for c++ tests like gcov in v8, but I'm confused about how to use it. Also, I tried to do the steps separately in coverage.py to generate the coverage report, but the build of native tests failed when  use_clang_coverage = true is_compoenent_build = false. The failure information are like:

chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/lib/linux/libclang_rt.profile-arm-android.a: No such file or directory 


You may have to update tools/clang/scripts/package.py and build clang locally in order to get that missing library for Android.
 
Is clang_coverage tool are not capable for Android native test?


As Abhishek said, it's not supported yet, but I can imagine it's doable with some reasonable effort.
 
What's more, I checked the usage of lcov, it asks enabling coverage when compile c/c++ source code. But the tests are built through ninja, seems not possible to enable the compile settings at the ninja -C  build command. I'm really confused about is there any way to measure the coverage of native tests?

Thank you for reply!

All best,

Jennifer

--
Reply all
Reply to author
Forward
0 new messages