subdir('tests')
foreach name, sources : fuzz_binaries
+ # Only fuzz_dns_qp uses the qp test helpers; give it just those sources
+ # rather than the whole libbindtest library (see libtest_qp_dep).
+ fuzz_deps = [libdns_dep, libisc_dep]
+ if name == 'fuzz_dns_qp'
+ fuzz_deps += libtest_qp_dep
+ endif
+
fuzz_bin = executable(
name,
sources,
implicit_include_directories: true,
install: false,
c_args: ['-Wno-vla'],
+ include_directories: test_inc,
link_args: fuzz_link_args,
sources: default_sanitize_options,
- dependencies: [
- libdns_dep,
- libisc_dep,
- libtest_dep,
- ],
+ dependencies: fuzz_deps,
)
test(
include_directories: test_inc,
)
+# Minimal dependency providing just the qp test helpers (compiled into the
+# consumer), for the fuzzers. It avoids linking the whole libbindtest shared
+# library, which cannot be built from static archives - e.g. the OSS-Fuzz
+# build, where libbindtest's netmgr wrappers clash with libisc/libns.
+libtest_qp_dep = declare_dependency(
+ sources: files('libtest' / 'qp.c'),
+ include_directories: test_inc,
+)
+
if not cmocka_dep.found()
subdir_done()
endif