unittests: allow for __wrap_ definitions

The cmocka paradigm to mock functions is using __wrap_ definitions.
This adds detection logic of wrapped functions in unit tests and
creates link args for each wrap definition.

(Requires a bit of ugly sed hacking, but necessary in this case as
meson does not support searching these files natively.)

BUG=b:77594752
TEST=with follow-up CL, can use __wrap_ in unit tests

Change-Id: I90bd21e46f0a114ea96d29b61022cee4b28ad462
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/mosys/+/2487259
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
1 file changed