coreboot-kgpe-d16/tests
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
..
acpi tests: Add acpi/acpigen-test test case 2021-02-23 17:10:10 +00:00
commonlib commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
device tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
include tests: Add lib/spd_cache-test test case 2021-05-14 08:59:29 +00:00
lib tests: Rework mocking facility 2021-06-10 19:26:46 +00:00
stubs Rename do_printk() to printk() 2021-04-14 10:38:09 +00:00
Makefile.inc tests: Rework mocking facility 2021-06-10 19:26:46 +00:00