Skip to content

Commit 2ed61af

Browse files
authored
Merge pull request #403 from CodeConstruct/mi-cov-visibility
test: define separate library for MI unit tests
2 parents 8556da5 + 46e8829 commit 2ed61af

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/libnvme-mi.map

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,3 @@ LIBNVME_MI_1_1 {
1919
local:
2020
*;
2121
};
22-
# API exported only for libnvme-mi internal test functions. These should
23-
# not be used other than through the in-tree tests, and cannot be considered
24-
# at all stable.
25-
LIBNVME_MI_TEST {
26-
global:
27-
nvme_mi_init_ep;
28-
nvme_mi_crc32_update;
29-
};

src/meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ libnvme_mi_dep = declare_dependency(
9393
link_with: libnvme_mi,
9494
)
9595

96+
# test library with all symbols visible, to use for MI unit tests. Should
97+
# match libnvme_mi above, but with no version script, and install: false.
98+
libnvme_mi_test = library(
99+
'nvme-mi-test', # produces libnvme-mi-test.so
100+
mi_sources,
101+
dependencies: mi_deps,
102+
include_directories: [incdir, internal_incdir],
103+
install: false,
104+
link_with: libccan,
105+
)
106+
107+
libnvme_mi_test_dep = declare_dependency(
108+
include_directories: ['.'],
109+
dependencies: [
110+
libuuid_dep.partial_dependency(compile_args: true, includes: true),
111+
],
112+
link_with: libnvme_mi_test,
113+
)
114+
96115
pkg.generate(libnvme_mi,
97116
filebase: 'libnvme-mi',
98117
name: 'libnvme-mi',

test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ zns = executable(
4242
mi = executable(
4343
'test-mi',
4444
['mi.c'],
45-
dependencies: libnvme_mi_dep,
45+
dependencies: libnvme_mi_test_dep,
4646
include_directories: [incdir, internal_incdir]
4747
)
4848

0 commit comments

Comments
 (0)