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 tests: Add lib/cbmem_stage_cache-test test case 2021-06-01 16:10:42 +00:00
b64_decode-test.c
bootmem-test.c tests/lib/bootmem-test: Add initialization of lb_mem fields 2021-04-13 16:03:27 +00:00
cbmem_console-test.c
cbmem_stage_cache-test.c tests: Add lib/cbmem_stage_cache-test test case 2021-06-01 16:10:42 +00:00
compute_ip_checksum-test.c tests: Add lib/compute_ip_checksum-test test case 2021-03-02 17:04:44 +00:00
coreboot_table-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
crc_byte-test.c tests/lib/crc_byte-test: Fix incorrect variable types 2021-05-05 11:45:45 +00:00
dimm_info_util-test.c tests: Add lib/dimm_info_util-test test case 2021-04-15 07:38:05 +00:00
edid-test.c
fmap-test.c commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
hexstrtobin-test.c
imd-test.c include/assert.h: Use mock_assert() for ENV_TEST targets 2021-04-09 06:20:04 +00:00
imd_cbmem-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
list-test.c
malloc-test.c tests/lib/malloc-test: Fix possible memory overrun 2021-04-11 21:05:25 +00:00
memchr-test.c
memcmp-test.c
memcpy-test.c
memmove-test.c
memrange-test.c tests: Add lib/memrange-test test case 2021-03-15 06:10:24 +00:00
memset-test.c tests/lib/memset-test: Add missing malloc check and free on error 2021-05-26 12:33:25 +00:00
region_file-test.c commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
rtc-test.c tests: Add lib/rtc-test test case 2021-04-21 09:18:56 +00:00
spd_cache-test.c tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
stack-test.c include/assert.h: Use mock_assert() for ENV_TEST targets 2021-04-09 06:20:04 +00:00
string-test.c
timestamp-test.c
uuid-test.c tests: Add lib/uuid-test test case 2021-04-06 06:56:47 +00:00