summaryrefslogtreecommitdiffstats
path: root/tests/meson.build
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-08-19 15:15:19 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2021-08-30 02:44:17 +0000
commit05b59d2ca30548f8460d87dbf8353ab1437cb204 (patch)
tree5298405692008e8230849f60ffc4887c90a00a62 /tests/meson.build
parent099e3785126437abafb4f4784f05ae469deb2d1d (diff)
downloadflashrom-05b59d2ca30548f8460d87dbf8353ab1437cb204.tar.gz
flashrom-05b59d2ca30548f8460d87dbf8353ab1437cb204.tar.bz2
flashrom-05b59d2ca30548f8460d87dbf8353ab1437cb204.zip
tests: Mock file i/o for linux_mtd and linux_spi tests
This patch adds an init-shutdown test for linux_mtd. Since linux_mtd is using file i/o operations, those are added to the framework and mocked. Another driver linux_spi which is also using file i/o, got an upgrade in this patch, and it is now reading max buffer size from sysfs (using mocked file i/o). A good side-effect is that linux_mtd is the first test for opaque masters, which is great to have in preparation for a change like CB:56103 but for opaque masters. BUG=b:181803212 TEST=builds and ninja test Change-Id: I73f0d6ff2ad5074add7a721ed3416230d3647e3f Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/56413 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index 63fec5aa6..53885a83b 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -39,6 +39,15 @@ mocks = [
'-Wl,--wrap=write',
'-Wl,--wrap=fopen',
'-Wl,--wrap=fopen64',
+ '-Wl,--wrap=stat',
+ '-Wl,--wrap=stat64',
+ '-Wl,--wrap=fread',
+ '-Wl,--wrap=fgets',
+ '-Wl,--wrap=fclose',
+ '-Wl,--wrap=feof',
+ '-Wl,--wrap=ferror',
+ '-Wl,--wrap=clearerr',
+ '-Wl,--wrap=setvbuf',
'-Wl,--wrap=rget_io_perms',
'-Wl,--wrap=test_outb',
'-Wl,--wrap=test_inb',