/util/dtrace.sh -export-ignore
/util/meson.build -export-ignore
/util/meson-system-test-init.sh -export-ignore
+/util/check_test_registration.py -export-ignore
/util/meson-dist-package.sh -export-ignore
'zt',
]
+_all_dns_tests = dns_tests + ['geoip', 'dnstap']
+run_command(
+ check_test_registration,
+ meson.current_source_dir(),
+ _all_dns_tests,
+ check: true,
+)
+
if config.has('HAVE_GEOIP2')
dns_tests += 'geoip'
endif
is_el8 = run_command('grep', '-q', '-F', 'platform:el8', '/etc/os-release', check: false).returncode() == 0
+_all_isc_test = isc_test + ['doh']
+run_command(
+ check_test_registration,
+ meson.current_source_dir(),
+ _all_isc_test,
+ check: true,
+)
+
if config.has('HAVE_LIBNGHTTP2') and not is_el8
isc_test += 'doh'
endif
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-foreach unit : [
+isccfg_tests = [
'duration',
'grammar',
'parser',
]
+
+run_command(
+ check_test_registration,
+ meson.current_source_dir(),
+ isccfg_tests,
+ check: true,
+)
+
+foreach unit : isccfg_tests
test_bin = executable(
unit,
files(f'@unit@_test.c'),
subdir_done()
endif
+check_test_registration = [python, files('../util/check_test_registration.py')]
+
subdir('bench')
subdir('dns')
subdir('isc')
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-foreach unit : [
+ns_tests = [
'notify',
'plugin',
'query',
]
+
+run_command(check_test_registration, meson.current_source_dir(), ns_tests, check: true)
+
+foreach unit : ns_tests
test_bin = executable(
unit,
files(f'@unit@_test.c', 'netmgr_wrap.c'),
--- /dev/null
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+
+import glob
+import os
+import sys
+
+test_dir = sys.argv[1]
+registered = sys.argv[2:]
+
+for path in sorted(glob.glob(os.path.join(test_dir, "*_test.c"))):
+ name = os.path.basename(path).removesuffix("_test.c")
+ if name not in registered:
+ print(
+ f"Unit test file {os.path.basename(path)} is not registered"
+ f" (add '{name}' to the list)",
+ file=sys.stderr,
+ )
+ sys.exit(1)