Code coverage with cross compiling #25131
ext-lumen-jakub-holoubek
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I need to do a build of C application using bazel with coverage instrumentation code. Issue I've got is that I'm compiling it on x86 for ARM based MCU.
I was trying to compile it with two ways:
bazel build //my_target -c dbg --collect_code_coverage --instrumentation_filter='.*Drivers.*\.c'
bazel build --per_file_copt='.*Drivers.*\.c@--coverage' --linkopt='--coverage' //my_target -c dbg
First command generates *.gcno files for all sources files used by my_target (during build I'm able to find it inside cache directory), however instrumentation code is so big, that it overflows the memory which is available on MCU. I thought that
--instrumentation_filter='.*Drivers.*\.c'
simply ensures the coverage will be done only for files which fits to the specified regexp but it is not the case.Second command forks fine just for the specified source files which has "Drivers" in the path. But *.gnco files doesn't persist in the bazel-out folder.
Do you know how to collect *.gnco files for specific source files using bazel?
Beta Was this translation helpful? Give feedback.
All reactions