diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:51:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:51:48 +0000 |
commit | 8d843cc9cc0e989d3929f204f77223cd08730c7a (patch) | |
tree | 1fcba17d10325d9d7ccb68b2eb48cd9bbba6a534 /test/ioctl/meson.build | |
parent | Releasing debian version 1.5-3. (diff) | |
download | libnvme-8d843cc9cc0e989d3929f204f77223cd08730c7a.tar.xz libnvme-8d843cc9cc0e989d3929f204f77223cd08730c7a.zip |
Merging upstream version 1.7.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/ioctl/meson.build')
-rw-r--r-- | test/ioctl/meson.build | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/ioctl/meson.build b/test/ioctl/meson.build new file mode 100644 index 0000000..b329d27 --- /dev/null +++ b/test/ioctl/meson.build @@ -0,0 +1,42 @@ +mock_ioctl = library( + 'mock-ioctl', + ['mock.c', 'util.c'], +) + +# Add mock-ioctl to the LD_PRELOAD path so it overrides libc. +# Append to LD_PRELOAD so existing libraries, e.g. libasan, are kept. +# If libasan isn't specified in the LD_PRELOAD path, ASAN warns about mock-ioctl +# being loaded first because its memory allocations might not get intercepted. +# But it appears this isn't a problem; ASAN errors in mock-ioctl are reported. +# This is likely because the executable still links with libasan before libc. +mock_ioctl_env = environment() +mock_ioctl_env.append('LD_PRELOAD', mock_ioctl.full_path()) +mock_ioctl_env.set('ASAN_OPTIONS', 'verify_asan_link_order=0') + +discovery = executable( + 'test-discovery', + 'discovery.c', + dependencies: libnvme_dep, + include_directories: [incdir, internal_incdir], + link_with: mock_ioctl, +) + +test('discovery', discovery, env: mock_ioctl_env) + +features = executable( + 'test-features', + 'features.c', + dependencies: libnvme_dep, + link_with: mock_ioctl, +) + +test('features', features, env: mock_ioctl_env) + +identify = executable( + 'test-identify', + 'identify.c', + dependencies: libnvme_dep, + link_with: mock_ioctl, +) + +test('identify', identify, env: mock_ioctl_env) |