summaryrefslogtreecommitdiffstats
path: root/tests/meson.build
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-04-23 15:47:03 +1000
committerNico Huber <nico.h@gmx.de>2021-04-27 12:47:48 +0000
commit98534e717bc457ea41a3bdf6e1d677fb0c1f63ca (patch)
tree950a32cec6ef8a6af73ae933d7cf337eaf72a762 /tests/meson.build
parentcffaac1e0f802e3fe27c4997e931586ee738f94a (diff)
downloadflashrom-98534e717bc457ea41a3bdf6e1d677fb0c1f63ca.tar.gz
flashrom-98534e717bc457ea41a3bdf6e1d677fb0c1f63ca.tar.bz2
flashrom-98534e717bc457ea41a3bdf6e1d677fb0c1f63ca.zip
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 <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/52498 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index 815ea7660..b087f2ce2 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',
]