fix: test: Register orphaned diff and skr unit tests in meson build

Both test files existed on disk but were never added to the meson test
list when the build system switched from autoconf.

skr_test.c also had a spurious #include <dns/tls.h> for a header that
never existed in this repo -- no symbols from it were used. Removing
the include is the only fix needed; the test itself is correct and
passes.

Assisted-by: Claude:claude-opus-4-7

Merge branch 'mnowak/fix-orphaned-unit-tests' into 'main'

See merge request isc-projects/bind9!12091
This commit is contained in:
Michal Nowak 2026-06-09 13:22:56 +02:00
commit 759784f4a2
8 changed files with 64 additions and 3 deletions

1
.gitattributes vendored
View file

@ -32,4 +32,5 @@ dangerfile.py export-ignore
/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

View file

@ -18,6 +18,7 @@ dns_tests = [
'dbiterator',
'dbversion',
'deleg',
'diff',
'dispatch',
'dns64',
'dst',
@ -40,6 +41,7 @@ dns_tests = [
'resolver',
'rsa',
'sigs',
'skr',
'time',
'transport',
'tsig',
@ -51,6 +53,14 @@ dns_tests = [
'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

View file

@ -40,7 +40,6 @@
#include <dns/secalg.h>
#include <dns/skr.h>
#include <dns/time.h>
#include <dns/tls.h>
#include "zone_p.h"

View file

@ -62,6 +62,14 @@ flaky_isc_test = [
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

View file

@ -9,11 +9,20 @@
# 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'),

View file

@ -52,6 +52,8 @@ if not cmocka_dep.found()
subdir_done()
endif
check_test_registration = [python, files('../util/check_test_registration.py')]
subdir('bench')
subdir('dns')
subdir('isc')

View file

@ -9,11 +9,15 @@
# 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'),

View file

@ -0,0 +1,28 @@
# 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)