coreboot-kgpe-d16/tests/lib
Patrick Georgi ce55ca2fca tests: Rework mocking facility
Using the linker's --wrap feature has the downside that it only covers
references across object files: If foo.c defines a() and b(), with b
calling a, --wrap=a does nothing to that call.

Instead, use objcopy to mark a weak and global so it can be overridden
by another implementation, but only for files originating in src/.

That way mocks - implemented in tests/ - become the source of truth.

TEST=Had such an issue with get_log_level() in a follow-up commit, and
the mock now takes over. Also, all existing unit tests still pass.

Change-Id: I99c6d6e44ecfc73366bf464d9c51c7da3f8db388
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55360
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
2021-06-10 19:26:46 +00:00
..
Makefile.inc
b64_decode-test.c
bootmem-test.c
cbmem_console-test.c
cbmem_stage_cache-test.c
compute_ip_checksum-test.c
coreboot_table-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
crc_byte-test.c
dimm_info_util-test.c
edid-test.c
fmap-test.c
hexstrtobin-test.c
imd-test.c
imd_cbmem-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
list-test.c
malloc-test.c
memchr-test.c
memcmp-test.c
memcpy-test.c
memmove-test.c
memrange-test.c
memset-test.c
region_file-test.c
rtc-test.c
spd_cache-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
stack-test.c
string-test.c
timestamp-test.c
uuid-test.c