-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infrastructure for code coverage? #612
Comments
Adding Are non-app tools for this useful to people? I suspect the most useful thing for this is Studio integration, but that's something that we'd track as part of Studio rather than the NDK. Would command-line tooling to automate:
be useful? I suspect this is probably of some use to people, but probably minimal when compared to having this integrated into Studio? |
@DanAlbert, I kindof repeat myself, but it would be much more efficient if run on the host, with emulation runtime. Also, such scenario is much easier to get integrted into AS. |
Sounds like not really any interest in non-Studio tooling then. I'll leave this open but shift it over to unscheduled and we can re-triage it some day if that changes. |
I have a few projects that only use the ndk itself (not the sdk) so separate tooling would be useful in my situation. Not sure if this too common though. I'd imagine most would want direct integration with studio. Is there a way to create the separate tooling and then maybe have studio interact with those separate tools? That way, developers have both options. PS: I thought it was kind of funny that the original stackoverflow post in this thread is actually my question :) It look to me a whole year before I found it. |
Hi, @DanAlbert I would appreciate if you can give some feedback. I'm trying to write a gradle task to do just this, below is my attempt so far:
The script was able to push and run the unit test on a connected device successfully. However, when I add the I guess what confuses me is where does the *.gcda files located if I run the unit test via gradle task? Or did the unit test run wrongly? What did I miss? Once I'm able to locate them, I should be able to pull them and generate the report. Any feedback is greatly appreciated, and Happy New Year! Edit: FWIW, I'm using CMake 3.6.4111459 and NDK 18.1.5063045 |
iirc you need to use |
Hi @DanAlbert , that's correct. That's how I was able to do it in my scripts. One thing to note @krysanify is that the GCOV_PREFIX is the path that is used where the executable is being run. So if you are running this on an Android device, it needs to be a valid path on the device itself. This is probably obvious but just wanted to mention it just in case :) |
hi @DanAlbert and @thejunkjon, thanks, guys. you're right, adding the gcov_prefix will generate the gcda files. |
Hi @DanAlbert , I am able to generate gcda files, but I am not able to generate coverage info due to gcov tool version mismatch, even though I am using gcov tool from ndk toolchain. This fails in ubuntu docker
But locally it works with apple clang's gcov (clang-1001.0.46.4) |
I think what that's saying is that Clang generates the data in a format that is too old for that gcov. @stephenhines what's the state of the art for coverage with Clang? iirc they had their own llvm-cov or something? |
Can you try Another alternative is to use the |
https://stackoverflow.com/q/48033153/632035
Looks like the stuff I'd made to do this in the platform is close to working for the NDK. Should look in to what we need to do to make this work out of the box.
The text was updated successfully, but these errors were encountered: