HomeClusterLabs Projects

Test: Add -fno-builtin -fno-inline to unittest.mk.

Description

Test: Add -fno-builtin -fno-inline to unittest.mk.

Previously, we were only adding these flags to the libcrmcommon_test.so
build. However, they apply to building the unit tests themselves as
well.

Attempting to mock realloc() fails because pcmk__realloc is getting
inlined into the unit test and then the gcc builtin function gets used
instead of the libc one. I'm not really sure why this hasn't come up
before, especially given that we have a unit test for pcmk_getpid_s
which is also a statically inlined function, and also calls a mocked
getpid. Maybe the combination of those factors plus the fact that
getpid is not a builtin makes it okay.

Details

Provenance
clumensAuthored on Dec 19 2023, 11:55 AM
Parents
rP58fb648c174c: Test: libcrmcommon: Exclude pcmk__output_formatters from coverage.
Branches
Unknown
Tags
Unknown