Replies: 1 comment
-
I ended up raising #13610 based on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My library needs to measure code coverage for tests that call
abort()
. The way this is typically done with GCC and gcov is to call a special gcov function in the signal handler forSIGABRT
:This works fine! But it can only be compiled when gcov instrumentation is enabled. So instead, I have something like:
main.c
:shim.h
:shim_gcov.c
:shim_none.c
:So if I'm building for coverage specifically with GCC and gcov, I want to use
shim_gcov.c
. If I'm not, I want to useshim_none.c
. The problem is I can't find a way to test this "behaviourally". By that I mean, I can do:...but it's entirely possible to generate a build for GCC + lcov, or even have both missing (Meson generates a warning but the project will build fine). In those cases, this check will be incorrect. It seems like it would be more sensible to use eg.
...but this is always false, whether
b_coverage
istrue
orfalse
. Another attempt was:...but that is always true.
How can I check for the availability of gcov's functions here?
For reproducability here's the full
meson.build
I use for this test:meson.build
:Beta Was this translation helpful? Give feedback.
All reactions