From 98534e717bc457ea41a3bdf6e1d677fb0c1f63ca Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Fri, 23 Apr 2021 15:47:03 +1000 Subject: tests: Add unit test to run init/shutdown for linux_spi.c The current implementation tests a particular path of the init procedure. There are two ways for it to succeed: reading the buffer size from sysfs and the fallback to getpagesize(). This test does the latter (fallback to getpagesize). Extract from meson-logs/testlog.txt for new test: [ RUN ] linux_spi_init_and_shutdown_test_success Testing programmer_init for programmer=25 ... __wrap_open64 is called __wrap_ioctl is called __wrap_ioctl is called __wrap_ioctl is called __wrap_fopen64 is called ... programmer_init for programmer=25 successful Testing programmer_shutdown for programmer=25 ... ... programmer_shutdown for programmer=25 successful [ OK ] linux_spi_init_and_shutdown_test_success BUG=b:181803212 TEST=builds and ninja test Change-Id: I4911fbb6f04371283f0e62d2196bdd691a227584 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/52498 Reviewed-by: Nico Huber Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- tests/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/meson.build') diff --git a/tests/meson.build b/tests/meson.build index 815ea766..b087f2ce 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -25,6 +25,13 @@ mocks = [ '-Wl,--wrap=physunmap', '-Wl,--wrap=physmap', '-Wl,--wrap=spi_send_command', + '-Wl,--wrap=sio_write', + '-Wl,--wrap=sio_read', + '-Wl,--wrap=open', + '-Wl,--wrap=open64', + '-Wl,--wrap=ioctl', + '-Wl,--wrap=fopen', + '-Wl,--wrap=fopen64', '-Wl,--gc-sections', ] -- cgit v1.2.3