From: Ondřej Surý Date: Tue, 3 May 2022 09:37:31 +0000 (+0200) Subject: Move all the unit tests to /tests// X-Git-Tag: v9.19.2~13^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c3b2dabe9a6b3c4a10f6498a1169f39ed031eed;p=thirdparty%2Fbind9.git Move all the unit tests to /tests// The unit tests are now using a common base, which means that lib/dns/tests/ code now has to include lib/isc/include/isc/test.h and link with lib/isc/test.c and lib/ns/tests has to include both libisc and libdns parts. Instead of cross-linking code between the directories, move the /lib//test.c to /tests/.c and /lib//include/test.h to /tests/include/tests/.h and create a single libtest.la convenience library in /tests/. At the same time, move the /lib//tests/ to /tests// (but keep it symlinked to the old location) and adjust paths accordingly. In few places, we are now using absolute paths instead of relative paths, because the directory level has changed. By moving the directories under the /tests/ directory, the test-related code is kept in a single place and we can avoid referencing files between libns->libdns->libisc which is unhealthy because they live in a separate Makefile-space. In the future, the /bin/tests/ should be merged to /tests/ and symlink kept, and the /fuzz/ directory moved to /tests/fuzz/. --- diff --git a/.clang-format b/.clang-format index 44f50b08519..41a90bf5bb0 100644 --- a/.clang-format +++ b/.clang-format @@ -34,12 +34,6 @@ PointerAlignment: Right PointerBindsToType: false IncludeBlocks: Regroup IncludeCategories: - - Regex: '^$' - Priority: 100 - - Regex: '^$' - Priority: 101 - - Regex: '^$' - Priority: 102 - Regex: '^$' - Priority: 100 - - Regex: '^$' - Priority: 101 - - Regex: '^$' - Priority: 102 - Regex: '^' Priority: 1 - Regex: '".*"' diff --git a/Makefile.am b/Makefile.am index f2005cfab78..2f095616591 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,10 @@ include $(top_srcdir)/Makefile.top SUBDIRS = . lib doc bin fuzz +if HAVE_CMOCKA +SUBDIRS += tests +endif HAVE_CMOCKA + BUILT_SOURCES = bind.keys.h CLEANFILES = bind.keys.h @@ -12,7 +16,7 @@ dist_sysconf_DATA = bind.keys .PHONY: doc -EXTRA_DIST = \ +EXTRA_DIST = \ util/bindkeys.pl \ contrib \ CHANGES \ diff --git a/Makefile.tests b/Makefile.tests index 7ae2c5ada12..d7b2e948e0f 100644 --- a/Makefile.tests +++ b/Makefile.tests @@ -3,18 +3,21 @@ unit-local: check +if HAVE_CMOCKA TESTS = $(check_PROGRAMS) +endif HAVE_CMOCKA -LOG_COMPILER = $(builddir)/../../unit-test-driver.sh +LOG_COMPILER = $(top_builddir)/tests/unit-test-driver.sh AM_CFLAGS += \ + -I$(top_srcdir)/tests/include \ $(TEST_CFLAGS) AM_CPPFLAGS += \ $(CMOCKA_CFLAGS) \ -DNAMED_PLUGINDIR=\"$(pkglibdir)\" \ - -DSKIPPED_TEST_EXIT_CODE=77 \ -DTESTS_DIR=\"$(abs_srcdir)\" LDADD += \ + $(top_builddir)/tests/libtest.la \ $(CMOCKA_LIBS) diff --git a/configure.ac b/configure.ac index 7b284ef6dae..b6b546e6c42 100644 --- a/configure.ac +++ b/configure.ac @@ -1581,14 +1581,15 @@ AC_CONFIG_FILES([doc/Makefile # Unit Tests -AC_CONFIG_FILES([lib/isc/tests/Makefile - lib/dns/tests/Makefile - lib/ns/tests/Makefile - lib/irs/tests/Makefile - lib/isccfg/tests/Makefile]) - -AC_CONFIG_FILES([lib/unit-test-driver.sh], - [chmod +x lib/unit-test-driver.sh]) +AC_CONFIG_FILES([tests/Makefile + tests/isc/Makefile + tests/dns/Makefile + tests/ns/Makefile + tests/irs/Makefile + tests/isccfg/Makefile]) + +AC_CONFIG_FILES([tests/unit-test-driver.sh], + [chmod +x tests/unit-test-driver.sh]) # System Tests diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am index cf49c33b388..35602b22597 100644 --- a/lib/dns/Makefile.am +++ b/lib/dns/Makefile.am @@ -321,7 +321,3 @@ if HAVE_LMDB libdns_la_CPPFLAGS += $(LMDB_CFLAGS) libdns_la_LIBADD += $(LMDB_LIBS) endif - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/dns/tests b/lib/dns/tests new file mode 120000 index 00000000000..e4acc10b187 --- /dev/null +++ b/lib/dns/tests @@ -0,0 +1 @@ +../../tests/dns \ No newline at end of file diff --git a/lib/irs/Makefile.am b/lib/irs/Makefile.am index eac972b26db..85c4065af34 100644 --- a/lib/irs/Makefile.am +++ b/lib/irs/Makefile.am @@ -25,7 +25,3 @@ libirs_la_LIBADD = \ libirs_la_LDFLAGS = \ $(AM_LDFLAGS) \ -release "$(PACKAGE_VERSION)" - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/irs/tests b/lib/irs/tests new file mode 120000 index 00000000000..247a63e1e5e --- /dev/null +++ b/lib/irs/tests @@ -0,0 +1 @@ +../../tests/irs \ No newline at end of file diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 16bb818f46b..fb443b5d6e6 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -251,7 +251,3 @@ libisc_la_CPPFLAGS += \ libisc_la_LIBADD += \ $(LIBXML2_LIBS) endif HAVE_LIBXML2 - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/isc/tests b/lib/isc/tests new file mode 120000 index 00000000000..9c8d7ce1d05 --- /dev/null +++ b/lib/isc/tests @@ -0,0 +1 @@ +../../tests/isc \ No newline at end of file diff --git a/lib/isccfg/Makefile.am b/lib/isccfg/Makefile.am index 3205e3b93bb..32e905aa965 100644 --- a/lib/isccfg/Makefile.am +++ b/lib/isccfg/Makefile.am @@ -33,7 +33,3 @@ libisccfg_la_LIBADD = \ libisccfg_la_LDFLAGS = \ $(AM_LDFLAGS) \ -release "$(PACKAGE_VERSION)" - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/isccfg/tests b/lib/isccfg/tests new file mode 120000 index 00000000000..1d7dfaf4234 --- /dev/null +++ b/lib/isccfg/tests @@ -0,0 +1 @@ +../../tests/isccfg \ No newline at end of file diff --git a/lib/ns/Makefile.am b/lib/ns/Makefile.am index b2d5d73b4cd..eb86aebe186 100644 --- a/lib/ns/Makefile.am +++ b/lib/ns/Makefile.am @@ -55,7 +55,3 @@ libns_la_LIBADD = \ libns_la_LDFLAGS = \ $(AM_LDFLAGS) \ -release "$(PACKAGE_VERSION)" - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/ns/tests b/lib/ns/tests new file mode 120000 index 00000000000..0ec3da8d123 --- /dev/null +++ b/lib/ns/tests @@ -0,0 +1 @@ +../../tests/ns \ No newline at end of file diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000000..78fe21f457e --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/unit-test-driver.sh diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 00000000000..0a19bb1d1fa --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,30 @@ +include $(top_srcdir)/Makefile.top + +AM_CPPFLAGS += \ + $(LIBISC_CFLAGS) \ + $(LIBDNS_CFLAGS) \ + $(LIBNS_CFLAGS) \ + $(LIBUV_CFLAGS) \ + -I$(top_srcdir)/lib/isc + +LDADD += \ + $(LIBISC_LIBS) \ + $(LIBDNS_LIBS) \ + $(LIBNS_LIBS) + +SUBDIRS = . isc dns ns isccfg irs + +check_LTLIBRARIES = libtest.la + +noinst_libtest_ladir = . +noinst_libtest_la_HEADERS = \ + include/tests/dns.h \ + include/tests/isc.h \ + include/tests/ns.h +libtest_la_SOURCES = \ + $(noinst_libtest_la_HEADERS) \ + dns.c \ + isc.c \ + ns.c + +include $(top_srcdir)/Makefile.tests diff --git a/lib/dns/test.c b/tests/dns.c similarity index 99% rename from lib/dns/test.c rename to tests/dns.c index fa93486f002..bbe8ce6e43d 100644 --- a/lib/dns/test.c +++ b/tests/dns.c @@ -53,7 +53,7 @@ #include #include -#include +#include dns_zonemgr_t *zonemgr = NULL; diff --git a/lib/dns/tests/.gitignore b/tests/dns/.gitignore similarity index 100% rename from lib/dns/tests/.gitignore rename to tests/dns/.gitignore diff --git a/lib/dns/tests/Kdh.+002+18602.key b/tests/dns/Kdh.+002+18602.key similarity index 100% rename from lib/dns/tests/Kdh.+002+18602.key rename to tests/dns/Kdh.+002+18602.key diff --git a/lib/dns/tests/Krsa.+005+29235.key b/tests/dns/Krsa.+005+29235.key similarity index 100% rename from lib/dns/tests/Krsa.+005+29235.key rename to tests/dns/Krsa.+005+29235.key diff --git a/lib/dns/tests/Makefile.am b/tests/dns/Makefile.am similarity index 89% rename from lib/dns/tests/Makefile.am rename to tests/dns/Makefile.am index 4dd04b39e43..0164a4ad878 100644 --- a/lib/dns/tests/Makefile.am +++ b/tests/dns/Makefile.am @@ -6,21 +6,15 @@ AM_CPPFLAGS += \ $(LIBUV_CFLAGS) \ $(KRB5_CFLAGS) \ -DSRCDIR=\"$(abs_srcdir)\" \ - -DBUILDDIR=\"$(abs_builddir)\" + -DBUILDDIR=\"$(abs_builddir)\" \ + -I$(top_srcdir)/lib/isc \ + -I$(top_srcdir)/lib/dns LDADD += \ - libdnstest.la \ $(LIBISC_LIBS) \ $(LIBUV_LIBS) \ $(LIBDNS_LIBS) -check_LTLIBRARIES = libdnstest.la -libdnstest_la_SOURCES = \ - ../../isc/test.c \ - ../../isc/include/isc/test.h \ - ../../dns/test.c \ - ../../dns/include/dns/test.h - check_PROGRAMS = \ acl_test \ db_test \ @@ -79,7 +73,8 @@ check_PROGRAMS += \ geoip_test_CPPFLAGS = \ $(AM_CPPFLAGS) \ - $(MAXMINDDB_CFLAGS) + $(MAXMINDDB_CFLAGS) \ + -DTEST_GEOIP_DATA=\"$(top_srcdir)/bin/tests/system/geoip2/data\" geoip_test_LDADD = \ $(LDADD) \ diff --git a/lib/dns/tests/acl_test.c b/tests/dns/acl_test.c similarity index 99% rename from lib/dns/tests/acl_test.c rename to tests/dns/acl_test.c index 9e3359c2675..210ab45dfad 100644 --- a/lib/dns/tests/acl_test.c +++ b/tests/dns/acl_test.c @@ -29,7 +29,7 @@ #include -#include +#include #define BUFLEN 255 #define BIGBUFLEN (70 * 1024) diff --git a/lib/dns/tests/comparekeys/Kexample-d.+008+53461.key b/tests/dns/comparekeys/Kexample-d.+008+53461.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-d.+008+53461.key rename to tests/dns/comparekeys/Kexample-d.+008+53461.key diff --git a/lib/dns/tests/comparekeys/Kexample-d.+008+53461.private b/tests/dns/comparekeys/Kexample-d.+008+53461.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-d.+008+53461.private rename to tests/dns/comparekeys/Kexample-d.+008+53461.private diff --git a/lib/dns/tests/comparekeys/Kexample-e.+008+53973.key b/tests/dns/comparekeys/Kexample-e.+008+53973.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-e.+008+53973.key rename to tests/dns/comparekeys/Kexample-e.+008+53973.key diff --git a/lib/dns/tests/comparekeys/Kexample-e.+008+53973.private b/tests/dns/comparekeys/Kexample-e.+008+53973.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-e.+008+53973.private rename to tests/dns/comparekeys/Kexample-e.+008+53973.private diff --git a/lib/dns/tests/comparekeys/Kexample-n.+008+37464.key b/tests/dns/comparekeys/Kexample-n.+008+37464.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-n.+008+37464.key rename to tests/dns/comparekeys/Kexample-n.+008+37464.key diff --git a/lib/dns/tests/comparekeys/Kexample-n.+008+37464.private b/tests/dns/comparekeys/Kexample-n.+008+37464.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-n.+008+37464.private rename to tests/dns/comparekeys/Kexample-n.+008+37464.private diff --git a/lib/dns/tests/comparekeys/Kexample-p.+008+53461.key b/tests/dns/comparekeys/Kexample-p.+008+53461.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-p.+008+53461.key rename to tests/dns/comparekeys/Kexample-p.+008+53461.key diff --git a/lib/dns/tests/comparekeys/Kexample-p.+008+53461.private b/tests/dns/comparekeys/Kexample-p.+008+53461.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-p.+008+53461.private rename to tests/dns/comparekeys/Kexample-p.+008+53461.private diff --git a/lib/dns/tests/comparekeys/Kexample-private.+002+65316.key b/tests/dns/comparekeys/Kexample-private.+002+65316.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-private.+002+65316.key rename to tests/dns/comparekeys/Kexample-private.+002+65316.key diff --git a/lib/dns/tests/comparekeys/Kexample-private.+002+65316.private b/tests/dns/comparekeys/Kexample-private.+002+65316.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-private.+002+65316.private rename to tests/dns/comparekeys/Kexample-private.+002+65316.private diff --git a/lib/dns/tests/comparekeys/Kexample-q.+008+53461.key b/tests/dns/comparekeys/Kexample-q.+008+53461.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-q.+008+53461.key rename to tests/dns/comparekeys/Kexample-q.+008+53461.key diff --git a/lib/dns/tests/comparekeys/Kexample-q.+008+53461.private b/tests/dns/comparekeys/Kexample-q.+008+53461.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample-q.+008+53461.private rename to tests/dns/comparekeys/Kexample-q.+008+53461.private diff --git a/lib/dns/tests/comparekeys/Kexample.+002+65316.key b/tests/dns/comparekeys/Kexample.+002+65316.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+002+65316.key rename to tests/dns/comparekeys/Kexample.+002+65316.key diff --git a/lib/dns/tests/comparekeys/Kexample.+002+65316.private b/tests/dns/comparekeys/Kexample.+002+65316.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+002+65316.private rename to tests/dns/comparekeys/Kexample.+002+65316.private diff --git a/lib/dns/tests/comparekeys/Kexample.+008+53461.key b/tests/dns/comparekeys/Kexample.+008+53461.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+008+53461.key rename to tests/dns/comparekeys/Kexample.+008+53461.key diff --git a/lib/dns/tests/comparekeys/Kexample.+008+53461.private b/tests/dns/comparekeys/Kexample.+008+53461.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+008+53461.private rename to tests/dns/comparekeys/Kexample.+008+53461.private diff --git a/lib/dns/tests/comparekeys/Kexample.+013+19786.key b/tests/dns/comparekeys/Kexample.+013+19786.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+013+19786.key rename to tests/dns/comparekeys/Kexample.+013+19786.key diff --git a/lib/dns/tests/comparekeys/Kexample.+013+19786.private b/tests/dns/comparekeys/Kexample.+013+19786.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+013+19786.private rename to tests/dns/comparekeys/Kexample.+013+19786.private diff --git a/lib/dns/tests/comparekeys/Kexample.+015+63663.key b/tests/dns/comparekeys/Kexample.+015+63663.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+015+63663.key rename to tests/dns/comparekeys/Kexample.+015+63663.key diff --git a/lib/dns/tests/comparekeys/Kexample.+015+63663.private b/tests/dns/comparekeys/Kexample.+015+63663.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample.+015+63663.private rename to tests/dns/comparekeys/Kexample.+015+63663.private diff --git a/lib/dns/tests/comparekeys/Kexample2.+002+19823.key b/tests/dns/comparekeys/Kexample2.+002+19823.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+002+19823.key rename to tests/dns/comparekeys/Kexample2.+002+19823.key diff --git a/lib/dns/tests/comparekeys/Kexample2.+002+19823.private b/tests/dns/comparekeys/Kexample2.+002+19823.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+002+19823.private rename to tests/dns/comparekeys/Kexample2.+002+19823.private diff --git a/lib/dns/tests/comparekeys/Kexample2.+008+37993.key b/tests/dns/comparekeys/Kexample2.+008+37993.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+008+37993.key rename to tests/dns/comparekeys/Kexample2.+008+37993.key diff --git a/lib/dns/tests/comparekeys/Kexample2.+008+37993.private b/tests/dns/comparekeys/Kexample2.+008+37993.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+008+37993.private rename to tests/dns/comparekeys/Kexample2.+008+37993.private diff --git a/lib/dns/tests/comparekeys/Kexample2.+013+16384.key b/tests/dns/comparekeys/Kexample2.+013+16384.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+013+16384.key rename to tests/dns/comparekeys/Kexample2.+013+16384.key diff --git a/lib/dns/tests/comparekeys/Kexample2.+013+16384.private b/tests/dns/comparekeys/Kexample2.+013+16384.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+013+16384.private rename to tests/dns/comparekeys/Kexample2.+013+16384.private diff --git a/lib/dns/tests/comparekeys/Kexample2.+015+37529.key b/tests/dns/comparekeys/Kexample2.+015+37529.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+015+37529.key rename to tests/dns/comparekeys/Kexample2.+015+37529.key diff --git a/lib/dns/tests/comparekeys/Kexample2.+015+37529.private b/tests/dns/comparekeys/Kexample2.+015+37529.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample2.+015+37529.private rename to tests/dns/comparekeys/Kexample2.+015+37529.private diff --git a/lib/dns/tests/comparekeys/Kexample3.+002+17187.key b/tests/dns/comparekeys/Kexample3.+002+17187.key similarity index 100% rename from lib/dns/tests/comparekeys/Kexample3.+002+17187.key rename to tests/dns/comparekeys/Kexample3.+002+17187.key diff --git a/lib/dns/tests/comparekeys/Kexample3.+002+17187.private b/tests/dns/comparekeys/Kexample3.+002+17187.private similarity index 100% rename from lib/dns/tests/comparekeys/Kexample3.+002+17187.private rename to tests/dns/comparekeys/Kexample3.+002+17187.private diff --git a/lib/dns/tests/db_test.c b/tests/dns/db_test.c similarity index 99% rename from lib/dns/tests/db_test.c rename to tests/dns/db_test.c index 78988746208..27fcf7deea5 100644 --- a/lib/dns/tests/db_test.c +++ b/tests/dns/db_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include #define BUFLEN 255 #define BIGBUFLEN (64 * 1024) diff --git a/lib/dns/tests/dbdiff_test.c b/tests/dns/dbdiff_test.c similarity index 99% rename from lib/dns/tests/dbdiff_test.c rename to tests/dns/dbdiff_test.c index 5f0c7dfc252..12490a8dcae 100644 --- a/lib/dns/tests/dbdiff_test.c +++ b/tests/dns/dbdiff_test.c @@ -29,7 +29,7 @@ #include #include -#include +#include #define BUFLEN 255 #define BIGBUFLEN (64 * 1024) diff --git a/lib/dns/tests/dbiterator_test.c b/tests/dns/dbiterator_test.c similarity index 99% rename from lib/dns/tests/dbiterator_test.c rename to tests/dns/dbiterator_test.c index 9daa4b6290e..90e8536fc2c 100644 --- a/lib/dns/tests/dbiterator_test.c +++ b/tests/dns/dbiterator_test.c @@ -28,7 +28,7 @@ #include #include -#include +#include #define BUFLEN 255 #define BIGBUFLEN (64 * 1024) diff --git a/lib/dns/tests/dbversion_test.c b/tests/dns/dbversion_test.c similarity index 99% rename from lib/dns/tests/dbversion_test.c rename to tests/dns/dbversion_test.c index 81d52581bd3..8124563f495 100644 --- a/lib/dns/tests/dbversion_test.c +++ b/tests/dns/dbversion_test.c @@ -35,7 +35,7 @@ #include #include -#include +#include static char tempname[11] = "dtXXXXXXXX"; static dns_db_t *db1 = NULL, *db2 = NULL; diff --git a/lib/dns/tests/dh_test.c b/tests/dns/dh_test.c similarity index 97% rename from lib/dns/tests/dh_test.c rename to tests/dns/dh_test.c index d1a938fb3cf..acc7c697fce 100644 --- a/lib/dns/tests/dh_test.c +++ b/tests/dns/dh_test.c @@ -28,9 +28,9 @@ #include -#include "../dst_internal.h" +#include "dst_internal.h" -#include +#include static int setup_test(void **state) { diff --git a/lib/dns/tests/dispatch_test.c b/tests/dns/dispatch_test.c similarity index 99% rename from lib/dns/tests/dispatch_test.c rename to tests/dns/dispatch_test.c index e90edea9ccd..a2973308640 100644 --- a/lib/dns/tests/dispatch_test.c +++ b/tests/dns/dispatch_test.c @@ -35,7 +35,7 @@ #include #include -#include +#include uv_sem_t sem; diff --git a/lib/dns/tests/dns64_test.c b/tests/dns/dns64_test.c similarity index 99% rename from lib/dns/tests/dns64_test.c rename to tests/dns/dns64_test.c index fd02504c186..6ca96551e60 100644 --- a/lib/dns/tests/dns64_test.c +++ b/tests/dns/dns64_test.c @@ -32,7 +32,7 @@ #include #include -#include +#include static void multiple_prefixes(void) { diff --git a/lib/dns/tests/dnstap_test.c b/tests/dns/dnstap_test.c similarity index 97% rename from lib/dns/tests/dnstap_test.c rename to tests/dns/dnstap_test.c index 25e68c47630..8fdb952a38b 100644 --- a/lib/dns/tests/dnstap_test.c +++ b/tests/dns/dnstap_test.c @@ -36,13 +36,13 @@ #include #include -#include +#include -#define TAPFILE "testdata/dnstap/dnstap.file" -#define TAPSOCK "testdata/dnstap/dnstap.sock" +#define TAPFILE TESTS_DIR "/testdata/dnstap/dnstap.file" +#define TAPSOCK TESTS_DIR "/testdata/dnstap/dnstap.sock" -#define TAPSAVED "testdata/dnstap/dnstap.saved" -#define TAPTEXT "testdata/dnstap/dnstap.text" +#define TAPSAVED TESTS_DIR "/testdata/dnstap/dnstap.saved" +#define TAPTEXT TESTS_DIR "/testdata/dnstap/dnstap.text" static int cleanup(void **state __attribute__((__unused__))) { diff --git a/lib/dns/tests/dst_test.c b/tests/dns/dst_test.c similarity index 99% rename from lib/dns/tests/dst_test.c rename to tests/dns/dst_test.c index 3073580b42f..28bd2ec72e1 100644 --- a/lib/dns/tests/dst_test.c +++ b/tests/dns/dst_test.c @@ -31,9 +31,9 @@ #include -#include "../dst_internal.h" +#include "dst_internal.h" -#include +#include static int setup_test(void **state) { diff --git a/lib/dns/tests/geoip_test.c b/tests/dns/geoip_test.c similarity index 98% rename from lib/dns/tests/geoip_test.c rename to tests/dns/geoip_test.c index 9c7ba7d71e1..8af48f448c9 100644 --- a/lib/dns/tests/geoip_test.c +++ b/tests/dns/geoip_test.c @@ -32,12 +32,9 @@ #include -#include "../geoip2.c" +#include "geoip2.c" -#include - -/* Use GeoIP2 databases from the 'geoip2' system test */ -#define TEST_GEOIP_DATA "../../../bin/tests/system/geoip2/data" +#include static dns_geoip_databases_t geoip; diff --git a/lib/dns/tests/keytable_test.c b/tests/dns/keytable_test.c similarity index 99% rename from lib/dns/tests/keytable_test.c rename to tests/dns/keytable_test.c index e6aab79760e..bc7b60d12e2 100644 --- a/lib/dns/tests/keytable_test.c +++ b/tests/dns/keytable_test.c @@ -40,7 +40,7 @@ #include -#include +#include dns_keytable_t *keytable = NULL; dns_ntatable_t *ntatable = NULL; diff --git a/lib/dns/tests/master_test.c b/tests/dns/master_test.c similarity index 99% rename from lib/dns/tests/master_test.c rename to tests/dns/master_test.c index 755ad459a21..1642b0d12e3 100644 --- a/lib/dns/tests/master_test.c +++ b/tests/dns/master_test.c @@ -38,7 +38,7 @@ #include #include -#include +#include static void nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) { diff --git a/lib/dns/tests/mkraw.pl b/tests/dns/mkraw.pl similarity index 100% rename from lib/dns/tests/mkraw.pl rename to tests/dns/mkraw.pl diff --git a/lib/dns/tests/name_test.c b/tests/dns/name_test.c similarity index 99% rename from lib/dns/tests/name_test.c rename to tests/dns/name_test.c index d89100e8567..511ee3c8b34 100644 --- a/lib/dns/tests/name_test.c +++ b/tests/dns/name_test.c @@ -36,7 +36,7 @@ #include #include -#include +#include /* Set to true (or use -v option) for verbose output */ static bool verbose = false; diff --git a/lib/dns/tests/nsec3_test.c b/tests/dns/nsec3_test.c similarity index 99% rename from lib/dns/tests/nsec3_test.c rename to tests/dns/nsec3_test.c index f417bdd8c19..7d6e4247051 100644 --- a/lib/dns/tests/nsec3_test.c +++ b/tests/dns/nsec3_test.c @@ -28,7 +28,7 @@ #include #include -#include +#include static void iteration_test(const char *file, unsigned int expected) { diff --git a/lib/dns/tests/nsec3param_test.c b/tests/dns/nsec3param_test.c similarity index 99% rename from lib/dns/tests/nsec3param_test.c rename to tests/dns/nsec3param_test.c index c2ddee3199d..3bd50e59a4c 100644 --- a/lib/dns/tests/nsec3param_test.c +++ b/tests/dns/nsec3param_test.c @@ -30,9 +30,9 @@ #include #include -#include "../zone_p.h" +#include "zone_p.h" -#include +#include #define HASH 1 #define FLAGS 0 diff --git a/lib/dns/tests/peer_test.c b/tests/dns/peer_test.c similarity index 99% rename from lib/dns/tests/peer_test.c rename to tests/dns/peer_test.c index 40eb48d1e7d..32ef932d930 100644 --- a/lib/dns/tests/peer_test.c +++ b/tests/dns/peer_test.c @@ -26,7 +26,7 @@ #include -#include +#include /* Test DSCP set/get functions */ ISC_RUN_TEST_IMPL(dscp) { diff --git a/lib/dns/tests/private_test.c b/tests/dns/private_test.c similarity index 99% rename from lib/dns/tests/private_test.c rename to tests/dns/private_test.c index db7284a6a8c..adaf441cf41 100644 --- a/lib/dns/tests/private_test.c +++ b/tests/dns/private_test.c @@ -33,7 +33,7 @@ #include -#include +#include static dns_rdatatype_t privatetype = 65534; diff --git a/lib/dns/tests/rbt_test.c b/tests/dns/rbt_test.c similarity index 99% rename from lib/dns/tests/rbt_test.c rename to tests/dns/rbt_test.c index 9b88dff287a..c66c365e59f 100644 --- a/lib/dns/tests/rbt_test.c +++ b/tests/dns/rbt_test.c @@ -51,7 +51,7 @@ #include -#include +#include typedef struct { dns_rbt_t *rbt; diff --git a/lib/dns/tests/rbtdb_test.c b/tests/dns/rbtdb_test.c similarity index 98% rename from lib/dns/tests/rbtdb_test.c rename to tests/dns/rbtdb_test.c index f7ac5325519..817dd67e2fe 100644 --- a/lib/dns/tests/rbtdb_test.c +++ b/tests/dns/rbtdb_test.c @@ -27,17 +27,19 @@ #include #include #include - -#include +#define KEEP_BEFORE /* Include the main file */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" #undef CHECK -#include "../rbtdb.c" +#include "rbtdb.c" #pragma GCC diagnostic pop +#undef CHECK +#include + const char *ownercase_vectors[12][2] = { { "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz", diff --git a/lib/dns/tests/rdata_test.c b/tests/dns/rdata_test.c similarity index 99% rename from lib/dns/tests/rdata_test.c rename to tests/dns/rdata_test.c index cee2e0b148e..71149eafaff 100644 --- a/lib/dns/tests/rdata_test.c +++ b/tests/dns/rdata_test.c @@ -33,7 +33,7 @@ #include -#include +#include static bool debug = false; diff --git a/lib/dns/tests/rdataset_test.c b/tests/dns/rdataset_test.c similarity index 99% rename from lib/dns/tests/rdataset_test.c rename to tests/dns/rdataset_test.c index 3d340cf1111..e9b47ecbf3f 100644 --- a/lib/dns/tests/rdataset_test.c +++ b/tests/dns/rdataset_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include /* test trimming of rdataset TTLs */ ISC_RUN_TEST_IMPL(trimttl) { diff --git a/lib/dns/tests/rdatasetstats_test.c b/tests/dns/rdatasetstats_test.c similarity index 99% rename from lib/dns/tests/rdatasetstats_test.c rename to tests/dns/rdatasetstats_test.c index cfb9c489ad7..743803474c3 100644 --- a/lib/dns/tests/rdatasetstats_test.c +++ b/tests/dns/rdatasetstats_test.c @@ -29,7 +29,7 @@ #include -#include +#include static void set_typestats(dns_stats_t *stats, dns_rdatatype_t type) { diff --git a/lib/dns/tests/resolver_test.c b/tests/dns/resolver_test.c similarity index 99% rename from lib/dns/tests/resolver_test.c rename to tests/dns/resolver_test.c index c11c6aeff63..634dbc4a289 100644 --- a/lib/dns/tests/resolver_test.c +++ b/tests/dns/resolver_test.c @@ -34,7 +34,7 @@ #include #include -#include +#include static dns_dispatchmgr_t *dispatchmgr = NULL; static dns_dispatch_t *dispatch = NULL; diff --git a/lib/dns/tests/rsa_test.c b/tests/dns/rsa_test.c similarity index 99% rename from lib/dns/tests/rsa_test.c rename to tests/dns/rsa_test.c index 0b169c3603d..8b2bd892195 100644 --- a/lib/dns/tests/rsa_test.c +++ b/tests/dns/rsa_test.c @@ -26,9 +26,9 @@ #include #include -#include "../dst_internal.h" +#include "dst_internal.h" -#include +#include static int setup_test(void **state) { diff --git a/lib/dns/tests/sigs_test.c b/tests/dns/sigs_test.c similarity index 99% rename from lib/dns/tests/sigs_test.c rename to tests/dns/sigs_test.c index 135bdddef50..55183057f1c 100644 --- a/lib/dns/tests/sigs_test.c +++ b/tests/dns/sigs_test.c @@ -43,9 +43,9 @@ #include -#include "../zone_p.h" +#include "zone_p.h" -#include +#include /*% * Structure characterizing a single diff tuple in the dns_diff_t structure diff --git a/lib/dns/tests/testdata/db/data.db b/tests/dns/testdata/db/data.db similarity index 100% rename from lib/dns/tests/testdata/db/data.db rename to tests/dns/testdata/db/data.db diff --git a/lib/dns/tests/testdata/dbiterator/zone1.data b/tests/dns/testdata/dbiterator/zone1.data similarity index 100% rename from lib/dns/tests/testdata/dbiterator/zone1.data rename to tests/dns/testdata/dbiterator/zone1.data diff --git a/lib/dns/tests/testdata/dbiterator/zone2.data b/tests/dns/testdata/dbiterator/zone2.data similarity index 100% rename from lib/dns/tests/testdata/dbiterator/zone2.data rename to tests/dns/testdata/dbiterator/zone2.data diff --git a/lib/dns/tests/testdata/diff/zone1.data b/tests/dns/testdata/diff/zone1.data similarity index 100% rename from lib/dns/tests/testdata/diff/zone1.data rename to tests/dns/testdata/diff/zone1.data diff --git a/lib/dns/tests/testdata/diff/zone2.data b/tests/dns/testdata/diff/zone2.data similarity index 100% rename from lib/dns/tests/testdata/diff/zone2.data rename to tests/dns/testdata/diff/zone2.data diff --git a/lib/dns/tests/testdata/diff/zone3.data b/tests/dns/testdata/diff/zone3.data similarity index 100% rename from lib/dns/tests/testdata/diff/zone3.data rename to tests/dns/testdata/diff/zone3.data diff --git a/lib/dns/tests/testdata/dnstap/dnstap.saved b/tests/dns/testdata/dnstap/dnstap.saved similarity index 100% rename from lib/dns/tests/testdata/dnstap/dnstap.saved rename to tests/dns/testdata/dnstap/dnstap.saved diff --git a/lib/dns/tests/testdata/dnstap/dnstap.text b/tests/dns/testdata/dnstap/dnstap.text similarity index 100% rename from lib/dns/tests/testdata/dnstap/dnstap.text rename to tests/dns/testdata/dnstap/dnstap.text diff --git a/lib/dns/tests/testdata/dnstap/query.auth b/tests/dns/testdata/dnstap/query.auth similarity index 100% rename from lib/dns/tests/testdata/dnstap/query.auth rename to tests/dns/testdata/dnstap/query.auth diff --git a/lib/dns/tests/testdata/dnstap/query.recursive b/tests/dns/testdata/dnstap/query.recursive similarity index 100% rename from lib/dns/tests/testdata/dnstap/query.recursive rename to tests/dns/testdata/dnstap/query.recursive diff --git a/lib/dns/tests/testdata/dnstap/response.auth b/tests/dns/testdata/dnstap/response.auth similarity index 100% rename from lib/dns/tests/testdata/dnstap/response.auth rename to tests/dns/testdata/dnstap/response.auth diff --git a/lib/dns/tests/testdata/dnstap/response.recursive b/tests/dns/testdata/dnstap/response.recursive similarity index 100% rename from lib/dns/tests/testdata/dnstap/response.recursive rename to tests/dns/testdata/dnstap/response.recursive diff --git a/lib/dns/tests/testdata/dst/Ktest.+008+11349.key b/tests/dns/testdata/dst/Ktest.+008+11349.key similarity index 100% rename from lib/dns/tests/testdata/dst/Ktest.+008+11349.key rename to tests/dns/testdata/dst/Ktest.+008+11349.key diff --git a/lib/dns/tests/testdata/dst/Ktest.+008+11349.private b/tests/dns/testdata/dst/Ktest.+008+11349.private similarity index 100% rename from lib/dns/tests/testdata/dst/Ktest.+008+11349.private rename to tests/dns/testdata/dst/Ktest.+008+11349.private diff --git a/lib/dns/tests/testdata/dst/Ktest.+013+49130.key b/tests/dns/testdata/dst/Ktest.+013+49130.key similarity index 100% rename from lib/dns/tests/testdata/dst/Ktest.+013+49130.key rename to tests/dns/testdata/dst/Ktest.+013+49130.key diff --git a/lib/dns/tests/testdata/dst/Ktest.+013+49130.private b/tests/dns/testdata/dst/Ktest.+013+49130.private similarity index 100% rename from lib/dns/tests/testdata/dst/Ktest.+013+49130.private rename to tests/dns/testdata/dst/Ktest.+013+49130.private diff --git a/lib/dns/tests/testdata/dst/test1.data b/tests/dns/testdata/dst/test1.data similarity index 100% rename from lib/dns/tests/testdata/dst/test1.data rename to tests/dns/testdata/dst/test1.data diff --git a/lib/dns/tests/testdata/dst/test1.ecdsa256sig b/tests/dns/testdata/dst/test1.ecdsa256sig similarity index 100% rename from lib/dns/tests/testdata/dst/test1.ecdsa256sig rename to tests/dns/testdata/dst/test1.ecdsa256sig diff --git a/lib/dns/tests/testdata/dst/test1.rsasha256sig b/tests/dns/testdata/dst/test1.rsasha256sig similarity index 100% rename from lib/dns/tests/testdata/dst/test1.rsasha256sig rename to tests/dns/testdata/dst/test1.rsasha256sig diff --git a/lib/dns/tests/testdata/dst/test2.data b/tests/dns/testdata/dst/test2.data similarity index 100% rename from lib/dns/tests/testdata/dst/test2.data rename to tests/dns/testdata/dst/test2.data diff --git a/lib/dns/tests/testdata/dstrandom/random.data b/tests/dns/testdata/dstrandom/random.data similarity index 100% rename from lib/dns/tests/testdata/dstrandom/random.data rename to tests/dns/testdata/dstrandom/random.data diff --git a/lib/dns/tests/testdata/master/.gitignore b/tests/dns/testdata/master/.gitignore similarity index 100% rename from lib/dns/tests/testdata/master/.gitignore rename to tests/dns/testdata/master/.gitignore diff --git a/lib/dns/tests/testdata/master/master1.data b/tests/dns/testdata/master/master1.data similarity index 100% rename from lib/dns/tests/testdata/master/master1.data rename to tests/dns/testdata/master/master1.data diff --git a/lib/dns/tests/testdata/master/master10.data b/tests/dns/testdata/master/master10.data similarity index 100% rename from lib/dns/tests/testdata/master/master10.data rename to tests/dns/testdata/master/master10.data diff --git a/lib/dns/tests/testdata/master/master11.data b/tests/dns/testdata/master/master11.data similarity index 100% rename from lib/dns/tests/testdata/master/master11.data rename to tests/dns/testdata/master/master11.data diff --git a/lib/dns/tests/testdata/master/master12.data.in b/tests/dns/testdata/master/master12.data.in similarity index 100% rename from lib/dns/tests/testdata/master/master12.data.in rename to tests/dns/testdata/master/master12.data.in diff --git a/lib/dns/tests/testdata/master/master13.data.in b/tests/dns/testdata/master/master13.data.in similarity index 100% rename from lib/dns/tests/testdata/master/master13.data.in rename to tests/dns/testdata/master/master13.data.in diff --git a/lib/dns/tests/testdata/master/master14.data.in b/tests/dns/testdata/master/master14.data.in similarity index 100% rename from lib/dns/tests/testdata/master/master14.data.in rename to tests/dns/testdata/master/master14.data.in diff --git a/lib/dns/tests/testdata/master/master15.data b/tests/dns/testdata/master/master15.data similarity index 100% rename from lib/dns/tests/testdata/master/master15.data rename to tests/dns/testdata/master/master15.data diff --git a/lib/dns/tests/testdata/master/master16.data b/tests/dns/testdata/master/master16.data similarity index 100% rename from lib/dns/tests/testdata/master/master16.data rename to tests/dns/testdata/master/master16.data diff --git a/lib/dns/tests/testdata/master/master17.data b/tests/dns/testdata/master/master17.data similarity index 100% rename from lib/dns/tests/testdata/master/master17.data rename to tests/dns/testdata/master/master17.data diff --git a/lib/dns/tests/testdata/master/master18.data b/tests/dns/testdata/master/master18.data similarity index 100% rename from lib/dns/tests/testdata/master/master18.data rename to tests/dns/testdata/master/master18.data diff --git a/lib/dns/tests/testdata/master/master2.data b/tests/dns/testdata/master/master2.data similarity index 100% rename from lib/dns/tests/testdata/master/master2.data rename to tests/dns/testdata/master/master2.data diff --git a/lib/dns/tests/testdata/master/master3.data b/tests/dns/testdata/master/master3.data similarity index 100% rename from lib/dns/tests/testdata/master/master3.data rename to tests/dns/testdata/master/master3.data diff --git a/lib/dns/tests/testdata/master/master4.data b/tests/dns/testdata/master/master4.data similarity index 100% rename from lib/dns/tests/testdata/master/master4.data rename to tests/dns/testdata/master/master4.data diff --git a/lib/dns/tests/testdata/master/master5.data b/tests/dns/testdata/master/master5.data similarity index 100% rename from lib/dns/tests/testdata/master/master5.data rename to tests/dns/testdata/master/master5.data diff --git a/lib/dns/tests/testdata/master/master6.data b/tests/dns/testdata/master/master6.data similarity index 100% rename from lib/dns/tests/testdata/master/master6.data rename to tests/dns/testdata/master/master6.data diff --git a/lib/dns/tests/testdata/master/master7.data b/tests/dns/testdata/master/master7.data similarity index 100% rename from lib/dns/tests/testdata/master/master7.data rename to tests/dns/testdata/master/master7.data diff --git a/lib/dns/tests/testdata/master/master8.data b/tests/dns/testdata/master/master8.data similarity index 100% rename from lib/dns/tests/testdata/master/master8.data rename to tests/dns/testdata/master/master8.data diff --git a/lib/dns/tests/testdata/master/master9.data b/tests/dns/testdata/master/master9.data similarity index 100% rename from lib/dns/tests/testdata/master/master9.data rename to tests/dns/testdata/master/master9.data diff --git a/lib/dns/tests/testdata/nsec3/1024.db b/tests/dns/testdata/nsec3/1024.db similarity index 100% rename from lib/dns/tests/testdata/nsec3/1024.db rename to tests/dns/testdata/nsec3/1024.db diff --git a/lib/dns/tests/testdata/nsec3/2048.db b/tests/dns/testdata/nsec3/2048.db similarity index 100% rename from lib/dns/tests/testdata/nsec3/2048.db rename to tests/dns/testdata/nsec3/2048.db diff --git a/lib/dns/tests/testdata/nsec3/4096.db b/tests/dns/testdata/nsec3/4096.db similarity index 100% rename from lib/dns/tests/testdata/nsec3/4096.db rename to tests/dns/testdata/nsec3/4096.db diff --git a/lib/dns/tests/testdata/nsec3/min-1024.db b/tests/dns/testdata/nsec3/min-1024.db similarity index 100% rename from lib/dns/tests/testdata/nsec3/min-1024.db rename to tests/dns/testdata/nsec3/min-1024.db diff --git a/lib/dns/tests/testdata/nsec3/min-2048.db b/tests/dns/testdata/nsec3/min-2048.db similarity index 100% rename from lib/dns/tests/testdata/nsec3/min-2048.db rename to tests/dns/testdata/nsec3/min-2048.db diff --git a/lib/dns/tests/testdata/nsec3param/nsec3.db.signed b/tests/dns/testdata/nsec3param/nsec3.db.signed similarity index 100% rename from lib/dns/tests/testdata/nsec3param/nsec3.db.signed rename to tests/dns/testdata/nsec3param/nsec3.db.signed diff --git a/lib/dns/tests/testdata/zt/zone1.db b/tests/dns/testdata/zt/zone1.db similarity index 100% rename from lib/dns/tests/testdata/zt/zone1.db rename to tests/dns/testdata/zt/zone1.db diff --git a/lib/dns/tests/testkeys/Kexample.+008+20386.key b/tests/dns/testkeys/Kexample.+008+20386.key similarity index 100% rename from lib/dns/tests/testkeys/Kexample.+008+20386.key rename to tests/dns/testkeys/Kexample.+008+20386.key diff --git a/lib/dns/tests/testkeys/Kexample.+008+20386.private b/tests/dns/testkeys/Kexample.+008+20386.private similarity index 100% rename from lib/dns/tests/testkeys/Kexample.+008+20386.private rename to tests/dns/testkeys/Kexample.+008+20386.private diff --git a/lib/dns/tests/testkeys/Kexample.+008+37464.key b/tests/dns/testkeys/Kexample.+008+37464.key similarity index 100% rename from lib/dns/tests/testkeys/Kexample.+008+37464.key rename to tests/dns/testkeys/Kexample.+008+37464.key diff --git a/lib/dns/tests/testkeys/Kexample.+008+37464.private b/tests/dns/testkeys/Kexample.+008+37464.private similarity index 100% rename from lib/dns/tests/testkeys/Kexample.+008+37464.private rename to tests/dns/testkeys/Kexample.+008+37464.private diff --git a/lib/dns/tests/time_test.c b/tests/dns/time_test.c similarity index 99% rename from lib/dns/tests/time_test.c rename to tests/dns/time_test.c index c11b4b9fd40..f6e19481f45 100644 --- a/lib/dns/tests/time_test.c +++ b/tests/dns/time_test.c @@ -27,7 +27,7 @@ #include -#include +#include #define TEST_ORIGIN "test" diff --git a/lib/dns/tests/tsig_test.c b/tests/dns/tsig_test.c similarity index 99% rename from lib/dns/tests/tsig_test.c rename to tests/dns/tsig_test.c index dead784185c..f94a0fa0169 100644 --- a/lib/dns/tests/tsig_test.c +++ b/tests/dns/tsig_test.c @@ -30,9 +30,9 @@ #include #include -#include "../tsig_p.h" +#include "tsig_p.h" -#include +#include #define TEST_ORIGIN "test" diff --git a/lib/dns/tests/update_test.c b/tests/dns/update_test.c similarity index 99% rename from lib/dns/tests/update_test.c rename to tests/dns/update_test.c index 7c50192a840..afeaa5ce830 100644 --- a/lib/dns/tests/update_test.c +++ b/tests/dns/update_test.c @@ -29,8 +29,7 @@ #include #include - -#include +#define KEEP_BEFORE /* * Fix the linking order problem for overridden isc_stdtime_get() by making @@ -40,9 +39,12 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" #undef CHECK -#include "../update.c" +#include "update.c" #pragma GCC diagnostic pop +#undef CHECK +#include + static int setup_test(void **state) { UNUSED(state); diff --git a/lib/dns/tests/zonemgr_test.c b/tests/dns/zonemgr_test.c similarity index 99% rename from lib/dns/tests/zonemgr_test.c rename to tests/dns/zonemgr_test.c index bca643887e8..cf1c718ba2c 100644 --- a/lib/dns/tests/zonemgr_test.c +++ b/tests/dns/zonemgr_test.c @@ -31,7 +31,7 @@ #include #include -#include +#include /* create zone manager */ ISC_RUN_TEST_IMPL(dns_zonemgr_create) { diff --git a/lib/dns/tests/zt_test.c b/tests/dns/zt_test.c similarity index 99% rename from lib/dns/tests/zt_test.c rename to tests/dns/zt_test.c index 981831349c3..74cbe059a23 100644 --- a/lib/dns/tests/zt_test.c +++ b/tests/dns/zt_test.c @@ -37,7 +37,7 @@ #include #include -#include +#include static int _setup(void **state) { diff --git a/tests/include/tests/.clang-format b/tests/include/tests/.clang-format new file mode 120000 index 00000000000..0e62f72bcfa --- /dev/null +++ b/tests/include/tests/.clang-format @@ -0,0 +1 @@ +../../../.clang-format.headers \ No newline at end of file diff --git a/lib/dns/include/dns/test.h b/tests/include/tests/dns.h similarity index 99% rename from lib/dns/include/dns/test.h rename to tests/include/tests/dns.h index e4e3e7c2923..64a265b6609 100644 --- a/lib/dns/include/dns/test.h +++ b/tests/include/tests/dns.h @@ -32,7 +32,7 @@ #include #include -#include +#include extern dns_zonemgr_t *zonemgr; diff --git a/lib/isc/include/isc/test.h b/tests/include/tests/isc.h similarity index 98% rename from lib/isc/include/isc/test.h rename to tests/include/tests/isc.h index 14f464ef24a..38dadb46791 100644 --- a/lib/isc/include/isc/test.h +++ b/tests/include/tests/isc.h @@ -31,9 +31,9 @@ #include #include -#include "../netmgr_p.h" -#include "../task_p.h" -#include "../timer_p.h" +#include "netmgr_p.h" +#include "task_p.h" +#include "timer_p.h" #define CHECK(r) \ do { \ diff --git a/lib/ns/include/ns/test.h b/tests/include/tests/ns.h similarity index 99% rename from lib/ns/include/ns/test.h rename to tests/include/tests/ns.h index 3b5fec1a862..2317e7daee2 100644 --- a/lib/ns/include/ns/test.h +++ b/tests/include/tests/ns.h @@ -34,7 +34,7 @@ #include #include -#include +#include typedef struct ns_test_id { const char *description; diff --git a/lib/irs/tests/Makefile.am b/tests/irs/Makefile.am similarity index 100% rename from lib/irs/tests/Makefile.am rename to tests/irs/Makefile.am diff --git a/lib/irs/tests/resconf_test.c b/tests/irs/resconf_test.c similarity index 100% rename from lib/irs/tests/resconf_test.c rename to tests/irs/resconf_test.c diff --git a/lib/irs/tests/testdata/domain.conf b/tests/irs/testdata/domain.conf similarity index 100% rename from lib/irs/tests/testdata/domain.conf rename to tests/irs/testdata/domain.conf diff --git a/lib/irs/tests/testdata/nameserver-v4.conf b/tests/irs/testdata/nameserver-v4.conf similarity index 100% rename from lib/irs/tests/testdata/nameserver-v4.conf rename to tests/irs/testdata/nameserver-v4.conf diff --git a/lib/irs/tests/testdata/nameserver-v6-scoped.conf b/tests/irs/testdata/nameserver-v6-scoped.conf similarity index 100% rename from lib/irs/tests/testdata/nameserver-v6-scoped.conf rename to tests/irs/testdata/nameserver-v6-scoped.conf diff --git a/lib/irs/tests/testdata/nameserver-v6.conf b/tests/irs/testdata/nameserver-v6.conf similarity index 100% rename from lib/irs/tests/testdata/nameserver-v6.conf rename to tests/irs/testdata/nameserver-v6.conf diff --git a/lib/irs/tests/testdata/options-attempts.conf b/tests/irs/testdata/options-attempts.conf similarity index 100% rename from lib/irs/tests/testdata/options-attempts.conf rename to tests/irs/testdata/options-attempts.conf diff --git a/lib/irs/tests/testdata/options-bad-ndots.conf b/tests/irs/testdata/options-bad-ndots.conf similarity index 100% rename from lib/irs/tests/testdata/options-bad-ndots.conf rename to tests/irs/testdata/options-bad-ndots.conf diff --git a/lib/irs/tests/testdata/options-debug.conf b/tests/irs/testdata/options-debug.conf similarity index 100% rename from lib/irs/tests/testdata/options-debug.conf rename to tests/irs/testdata/options-debug.conf diff --git a/lib/irs/tests/testdata/options-empty.conf b/tests/irs/testdata/options-empty.conf similarity index 100% rename from lib/irs/tests/testdata/options-empty.conf rename to tests/irs/testdata/options-empty.conf diff --git a/lib/irs/tests/testdata/options-ndots.conf b/tests/irs/testdata/options-ndots.conf similarity index 100% rename from lib/irs/tests/testdata/options-ndots.conf rename to tests/irs/testdata/options-ndots.conf diff --git a/lib/irs/tests/testdata/options-timeout.conf b/tests/irs/testdata/options-timeout.conf similarity index 100% rename from lib/irs/tests/testdata/options-timeout.conf rename to tests/irs/testdata/options-timeout.conf diff --git a/lib/irs/tests/testdata/options-unknown.conf b/tests/irs/testdata/options-unknown.conf similarity index 100% rename from lib/irs/tests/testdata/options-unknown.conf rename to tests/irs/testdata/options-unknown.conf diff --git a/lib/irs/tests/testdata/options.conf b/tests/irs/testdata/options.conf similarity index 100% rename from lib/irs/tests/testdata/options.conf rename to tests/irs/testdata/options.conf diff --git a/lib/irs/tests/testdata/port.conf b/tests/irs/testdata/port.conf similarity index 100% rename from lib/irs/tests/testdata/port.conf rename to tests/irs/testdata/port.conf diff --git a/lib/irs/tests/testdata/resolv.conf b/tests/irs/testdata/resolv.conf similarity index 100% rename from lib/irs/tests/testdata/resolv.conf rename to tests/irs/testdata/resolv.conf diff --git a/lib/irs/tests/testdata/search.conf b/tests/irs/testdata/search.conf similarity index 100% rename from lib/irs/tests/testdata/search.conf rename to tests/irs/testdata/search.conf diff --git a/lib/irs/tests/testdata/sortlist-v4.conf b/tests/irs/testdata/sortlist-v4.conf similarity index 100% rename from lib/irs/tests/testdata/sortlist-v4.conf rename to tests/irs/testdata/sortlist-v4.conf diff --git a/lib/irs/tests/testdata/timeout.conf b/tests/irs/testdata/timeout.conf similarity index 100% rename from lib/irs/tests/testdata/timeout.conf rename to tests/irs/testdata/timeout.conf diff --git a/lib/irs/tests/testdata/unknown.conf b/tests/irs/testdata/unknown.conf similarity index 100% rename from lib/irs/tests/testdata/unknown.conf rename to tests/irs/testdata/unknown.conf diff --git a/lib/isc/test.c b/tests/isc.c similarity index 94% rename from lib/isc/test.c rename to tests/isc.c index bcdda1eefdc..61e29c2a346 100644 --- a/lib/isc/test.c +++ b/tests/isc.c @@ -29,11 +29,11 @@ #include #include -#include "../netmgr_p.h" -#include "../task_p.h" -#include "../timer_p.h" +#include "netmgr_p.h" +#include "task_p.h" +#include "timer_p.h" -#include +#include isc_mem_t *mctx = NULL; isc_taskmgr_t *taskmgr = NULL; diff --git a/lib/isc/tests/Makefile.am b/tests/isc/Makefile.am similarity index 90% rename from lib/isc/tests/Makefile.am rename to tests/isc/Makefile.am index 8ea6da0d298..6ce570c8821 100644 --- a/lib/isc/tests/Makefile.am +++ b/tests/isc/Makefile.am @@ -3,19 +3,12 @@ include $(top_srcdir)/Makefile.top AM_CPPFLAGS += \ $(LIBISC_CFLAGS) \ $(LIBUV_CFLAGS) \ - -I.. + -I$(top_srcdir)/lib/isc LDADD += \ - libisctest.la \ $(LIBISC_LIBS) \ $(LIBUV_LIBS) -check_LTLIBRARIES = libisctest.la -libisctest_la_SOURCES = \ - ../../isc/test.c \ - ../../isc/include/isc/test.h \ - uv_wrap.h - check_PROGRAMS = \ aes_test \ buffer_test \ diff --git a/lib/isc/tests/aes_test.c b/tests/isc/aes_test.c similarity index 99% rename from lib/isc/tests/aes_test.c rename to tests/isc/aes_test.c index 8cc9d90defd..c328b92b02d 100644 --- a/lib/isc/tests/aes_test.c +++ b/tests/isc/aes_test.c @@ -29,7 +29,7 @@ #include #include -#include +#include /* * Test data from NIST KAT diff --git a/lib/isc/tests/buffer_test.c b/tests/isc/buffer_test.c similarity index 99% rename from lib/isc/tests/buffer_test.c rename to tests/isc/buffer_test.c index 43317ca46a3..8335248fa00 100644 --- a/lib/isc/tests/buffer_test.c +++ b/tests/isc/buffer_test.c @@ -32,7 +32,7 @@ #include #include -#include +#include /* reserve space in dynamic buffers */ ISC_RUN_TEST_IMPL(isc_buffer_reserve) { diff --git a/lib/isc/tests/counter_test.c b/tests/isc/counter_test.c similarity index 98% rename from lib/isc/tests/counter_test.c rename to tests/isc/counter_test.c index d32390849a8..065a6f0a3bf 100644 --- a/lib/isc/tests/counter_test.c +++ b/tests/isc/counter_test.c @@ -25,7 +25,7 @@ #include #include -#include +#include /* test isc_counter object */ ISC_RUN_TEST_IMPL(isc_counter) { diff --git a/lib/isc/tests/crc64_test.c b/tests/isc/crc64_test.c similarity index 98% rename from lib/isc/tests/crc64_test.c rename to tests/isc/crc64_test.c index d6253d6a546..9b8ff47b9e0 100644 --- a/lib/isc/tests/crc64_test.c +++ b/tests/isc/crc64_test.c @@ -28,7 +28,7 @@ #include #include -#include +#include #define TEST_INPUT(x) (x), sizeof(x) - 1 diff --git a/lib/isc/tests/doh_test.c b/tests/isc/doh_test.c similarity index 99% rename from lib/isc/tests/doh_test.c rename to tests/isc/doh_test.c index 244fc6a07ed..b8c5d1f81f5 100644 --- a/lib/isc/tests/doh_test.c +++ b/tests/isc/doh_test.c @@ -40,12 +40,12 @@ #include "uv_wrap.h" #define KEEP_BEFORE -#include "../netmgr/http.c" -#include "../netmgr/netmgr-int.h" -#include "../netmgr/socket.c" -#include "../netmgr_p.h" +#include "netmgr/http.c" +#include "netmgr/netmgr-int.h" +#include "netmgr/socket.c" +#include "netmgr_p.h" -#include +#include #define MAX_NM 2 diff --git a/lib/isc/tests/errno_test.c b/tests/isc/errno_test.c similarity index 99% rename from lib/isc/tests/errno_test.c rename to tests/isc/errno_test.c index c5ddbcb366b..11d48fa8f58 100644 --- a/lib/isc/tests/errno_test.c +++ b/tests/isc/errno_test.c @@ -26,7 +26,7 @@ #include #include -#include +#include typedef struct { int err; diff --git a/lib/isc/tests/file_test.c b/tests/isc/file_test.c similarity index 99% rename from lib/isc/tests/file_test.c rename to tests/isc/file_test.c index 7333fa8a0a0..39670b57eb8 100644 --- a/lib/isc/tests/file_test.c +++ b/tests/isc/file_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include #define NAME "internal" #define SHA "3bed2cb3a3acf7b6a8ef408420cc682d5520e26976d354254f528c965612054f" diff --git a/lib/isc/tests/hash_test.c b/tests/isc/hash_test.c similarity index 98% rename from lib/isc/tests/hash_test.c rename to tests/isc/hash_test.c index 4c6f020eb01..10a8c27e586 100644 --- a/lib/isc/tests/hash_test.c +++ b/tests/isc/hash_test.c @@ -32,7 +32,7 @@ #include #include -#include +#include /* Hash function test */ ISC_RUN_TEST_IMPL(isc_hash_function) { diff --git a/lib/isc/tests/heap_test.c b/tests/isc/heap_test.c similarity index 98% rename from lib/isc/tests/heap_test.c rename to tests/isc/heap_test.c index 0281afb0411..9e29a4b8123 100644 --- a/lib/isc/tests/heap_test.c +++ b/tests/isc/heap_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include struct e { unsigned int value; diff --git a/lib/isc/tests/hmac_test.c b/tests/isc/hmac_test.c similarity index 99% rename from lib/isc/tests/hmac_test.c rename to tests/isc/hmac_test.c index a6834766f91..ac567d68846 100644 --- a/lib/isc/tests/hmac_test.c +++ b/tests/isc/hmac_test.c @@ -29,9 +29,9 @@ #include #include -#include "../hmac.c" +#include "hmac.c" -#include +#include #define TEST_INPUT(x) (x), sizeof(x) - 1 diff --git a/lib/isc/tests/ht_test.c b/tests/isc/ht_test.c similarity index 99% rename from lib/isc/tests/ht_test.c rename to tests/isc/ht_test.c index d1b138cb244..152994e47db 100644 --- a/lib/isc/tests/ht_test.c +++ b/tests/isc/ht_test.c @@ -30,12 +30,12 @@ #include #include -#include +#include /* INCLUDE LAST */ #define mctx __mctx -#include "../ht.c" +#include "ht.c" #undef mctx static void diff --git a/lib/isc/tests/lex_test.c b/tests/isc/lex_test.c similarity index 99% rename from lib/isc/tests/lex_test.c rename to tests/isc/lex_test.c index f792f6d131e..cf6bfe2ea54 100644 --- a/lib/isc/tests/lex_test.c +++ b/tests/isc/lex_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include #define AS_STR(x) (x).value.as_textregion.base diff --git a/lib/isc/tests/md_test.c b/tests/isc/md_test.c similarity index 99% rename from lib/isc/tests/md_test.c rename to tests/isc/md_test.c index 5f8eb74a520..d7d154c13b1 100644 --- a/lib/isc/tests/md_test.c +++ b/tests/isc/md_test.c @@ -29,9 +29,9 @@ #include #include -#include "../md.c" +#include "md.c" -#include +#include #define TEST_INPUT(x) (x), sizeof(x) - 1 diff --git a/lib/isc/tests/mem_test.c b/tests/isc/mem_test.c similarity index 99% rename from lib/isc/tests/mem_test.c rename to tests/isc/mem_test.c index e3d838dc262..f2bbdbd3f47 100644 --- a/lib/isc/tests/mem_test.c +++ b/tests/isc/mem_test.c @@ -35,9 +35,9 @@ #include #include -#include "../mem_p.h" +#include "mem_p.h" -#include +#include #define MP1_FREEMAX 10 #define MP1_FILLCNT 10 diff --git a/lib/isc/tests/netaddr_test.c b/tests/isc/netaddr_test.c similarity index 99% rename from lib/isc/tests/netaddr_test.c rename to tests/isc/netaddr_test.c index 924c55e67ce..b44982c26b0 100644 --- a/lib/isc/tests/netaddr_test.c +++ b/tests/isc/netaddr_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include /* test isc_netaddr_isnetzero() */ ISC_RUN_TEST_IMPL(netaddr_isnetzero) { diff --git a/lib/isc/tests/netmgr_test.c b/tests/isc/netmgr_test.c similarity index 99% rename from lib/isc/tests/netmgr_test.c rename to tests/isc/netmgr_test.c index e71131f26f2..1bd5d688195 100644 --- a/lib/isc/tests/netmgr_test.c +++ b/tests/isc/netmgr_test.c @@ -35,13 +35,13 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" -#include "../netmgr/netmgr.c" -#include "../netmgr/socket.c" -#include "../netmgr/udp.c" -#include "../uv.c" +//#include "netmgr/netmgr.c" +#include "netmgr/socket.c" +#include "netmgr/udp.c" +#include "uv.c" #pragma GCC diagnostic pop -#include +#include typedef void (*stream_connect_function)(isc_nm_t *nm); diff --git a/lib/isc/tests/parse_test.c b/tests/isc/parse_test.c similarity index 98% rename from lib/isc/tests/parse_test.c rename to tests/isc/parse_test.c index e250a37eec4..a5b516a0271 100644 --- a/lib/isc/tests/parse_test.c +++ b/tests/isc/parse_test.c @@ -29,7 +29,7 @@ #include #include -#include +#include /* Test for 32 bit overflow on 64 bit machines in isc_parse_uint32 */ ISC_RUN_TEST_IMPL(parse_overflow) { diff --git a/lib/isc/tests/quota_test.c b/tests/isc/quota_test.c similarity index 99% rename from lib/isc/tests/quota_test.c rename to tests/isc/quota_test.c index 611f36f5c09..d4ae843a4a4 100644 --- a/lib/isc/tests/quota_test.c +++ b/tests/isc/quota_test.c @@ -19,7 +19,6 @@ #include #include #include -#include #define UNIT_TESTING #include @@ -28,8 +27,9 @@ #include #include #include +#include -#include +#include ISC_RUN_TEST_IMPL(isc_quota_get_set) { UNUSED(state); @@ -255,7 +255,7 @@ isc_thread_t g_threads[10 * 100]; static void * quota_detach(void *quotap) { isc_quota_t *quota = (isc_quota_t *)quotap; - uv_sleep(10000); + uv_sleep(10); isc_quota_detach("a); return ((isc_threadresult_t)0); } diff --git a/lib/isc/tests/radix_test.c b/tests/isc/radix_test.c similarity index 98% rename from lib/isc/tests/radix_test.c rename to tests/isc/radix_test.c index 642eafb5422..2fe9294d697 100644 --- a/lib/isc/tests/radix_test.c +++ b/tests/isc/radix_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include /* test radix searching */ ISC_RUN_TEST_IMPL(isc_radix_search) { diff --git a/lib/isc/tests/random_test.c b/tests/isc/random_test.c similarity index 99% rename from lib/isc/tests/random_test.c rename to tests/isc/random_test.c index af200085ce0..8c41e971382 100644 --- a/lib/isc/tests/random_test.c +++ b/tests/isc/random_test.c @@ -38,7 +38,7 @@ #include #include -#include +#include #define REPS 25000 diff --git a/lib/isc/tests/regex_test.c b/tests/isc/regex_test.c similarity index 99% rename from lib/isc/tests/regex_test.c rename to tests/isc/regex_test.c index 6336d76ab09..dd44d3bc899 100644 --- a/lib/isc/tests/regex_test.c +++ b/tests/isc/regex_test.c @@ -32,7 +32,7 @@ #include #include -#include +#include /* test isc_regex_validate() */ ISC_RUN_TEST_IMPL(regex_validate) { diff --git a/lib/isc/tests/result_test.c b/tests/isc/result_test.c similarity index 98% rename from lib/isc/tests/result_test.c rename to tests/isc/result_test.c index 319172a4aff..cca66b85d61 100644 --- a/lib/isc/tests/result_test.c +++ b/tests/isc/result_test.c @@ -25,7 +25,7 @@ #include #include -#include +#include /* convert result to identifier string */ ISC_RUN_TEST_IMPL(isc_result_toid) { diff --git a/lib/isc/tests/safe_test.c b/tests/isc/safe_test.c similarity index 98% rename from lib/isc/tests/safe_test.c rename to tests/isc/safe_test.c index 7428f824a24..39221649c22 100644 --- a/lib/isc/tests/safe_test.c +++ b/tests/isc/safe_test.c @@ -26,7 +26,7 @@ #include #include -#include +#include /* test isc_safe_memequal() */ ISC_RUN_TEST_IMPL(isc_safe_memequal) { diff --git a/lib/isc/tests/siphash_test.c b/tests/isc/siphash_test.c similarity index 99% rename from lib/isc/tests/siphash_test.c rename to tests/isc/siphash_test.c index f7d14a470ec..5480afd7919 100644 --- a/lib/isc/tests/siphash_test.c +++ b/tests/isc/siphash_test.c @@ -23,9 +23,9 @@ #include -#include "../siphash.c" +#include "siphash.c" -#include +#include const uint8_t vectors_sip64[64][8] = { { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72 }, diff --git a/lib/isc/tests/sockaddr_test.c b/tests/isc/sockaddr_test.c similarity index 99% rename from lib/isc/tests/sockaddr_test.c rename to tests/isc/sockaddr_test.c index b5f1568a1a7..126bfa9fe40 100644 --- a/lib/isc/tests/sockaddr_test.c +++ b/tests/isc/sockaddr_test.c @@ -28,7 +28,7 @@ #include #include -#include +#include /* test sockaddr hash */ ISC_RUN_TEST_IMPL(sockaddr_hash) { diff --git a/lib/isc/tests/stats_test.c b/tests/isc/stats_test.c similarity index 99% rename from lib/isc/tests/stats_test.c rename to tests/isc/stats_test.c index dd35ba1e60a..79d784e2df8 100644 --- a/lib/isc/tests/stats_test.c +++ b/tests/isc/stats_test.c @@ -26,7 +26,7 @@ #include #include -#include +#include /* test stats */ ISC_RUN_TEST_IMPL(isc_stats_basic) { diff --git a/lib/isc/tests/symtab_test.c b/tests/isc/symtab_test.c similarity index 99% rename from lib/isc/tests/symtab_test.c rename to tests/isc/symtab_test.c index 193b08d5b79..bcbc0c43bb2 100644 --- a/lib/isc/tests/symtab_test.c +++ b/tests/isc/symtab_test.c @@ -26,7 +26,7 @@ #include #include -#include +#include static void undefine(char *key, unsigned int type, isc_symvalue_t value, void *arg) { diff --git a/lib/isc/tests/task_test.c b/tests/isc/task_test.c similarity index 99% rename from lib/isc/tests/task_test.c rename to tests/isc/task_test.c index 9b60ec16cb9..f7a20786d71 100644 --- a/lib/isc/tests/task_test.c +++ b/tests/isc/task_test.c @@ -20,7 +20,6 @@ #include #include #include -#include #define UNIT_TESTING @@ -37,8 +36,9 @@ #include #include #include +#include -#include +#include /* Set to true (or use -v option) for verbose output */ static bool verbose = false; @@ -154,7 +154,7 @@ ISC_RUN_TEST_IMPL(all_events) { isc_task_send(task, &event); while ((atomic_load(&a) == 0 || atomic_load(&b) == 0) && i++ < 5000) { - uv_sleep(1000); + uv_sleep(1); } assert_int_not_equal(atomic_load(&a), 0); @@ -372,7 +372,7 @@ ISC_RUN_TEST_IMPL(task_exclusive) { } while (atomic_load(&counter) > 0) { - uv_sleep(1000); + uv_sleep(1); } } diff --git a/lib/isc/tests/testdata/file/keep b/tests/isc/testdata/file/keep similarity index 100% rename from lib/isc/tests/testdata/file/keep rename to tests/isc/testdata/file/keep diff --git a/lib/isc/tests/time_test.c b/tests/isc/time_test.c similarity index 99% rename from lib/isc/tests/time_test.c rename to tests/isc/time_test.c index 9649b831719..4b355a70030 100644 --- a/lib/isc/tests/time_test.c +++ b/tests/isc/time_test.c @@ -26,9 +26,9 @@ #include #include -#include "../time.c" +#include "time.c" -#include +#include #define NS_PER_S 1000000000 /*%< Nanoseconds per second. */ #define MAX_NS (NS_PER_S - 1) diff --git a/lib/isc/tests/timer_test.c b/tests/isc/timer_test.c similarity index 99% rename from lib/isc/tests/timer_test.c rename to tests/isc/timer_test.c index f61438b36ef..eeea6513710 100644 --- a/lib/isc/tests/timer_test.c +++ b/tests/isc/timer_test.c @@ -19,7 +19,6 @@ #include #include #include -#include #define UNIT_TESTING #include @@ -33,10 +32,11 @@ #include #include #include +#include -#include "../timer.c" +#include "timer.c" -#include +#include /* Set to true (or use -v option) for verbose output */ static bool verbose = false; @@ -509,7 +509,7 @@ ISC_RUN_TEST_IMPL(purge) { * Wait for shutdown processing to complete. */ while (!atomic_load(&shutdownflag)) { - uv_sleep(1000); + uv_sleep(1); } assert_int_equal(atomic_load(&errcnt), ISC_R_SUCCESS); diff --git a/lib/isc/tests/uv_wrap.h b/tests/isc/uv_wrap.h similarity index 100% rename from lib/isc/tests/uv_wrap.h rename to tests/isc/uv_wrap.h diff --git a/lib/isccfg/tests/Makefile.am b/tests/isccfg/Makefile.am similarity index 61% rename from lib/isccfg/tests/Makefile.am rename to tests/isccfg/Makefile.am index 9ccddfab5bf..73655a54012 100644 --- a/lib/isccfg/tests/Makefile.am +++ b/tests/isccfg/Makefile.am @@ -3,19 +3,14 @@ include $(top_srcdir)/Makefile.top AM_CPPFLAGS += \ $(LIBISC_CFLAGS) \ $(LIBDNS_CFLAGS) \ - $(LIBISCCFG_CFLAGS) + $(LIBISCCFG_CFLAGS) \ + -I$(top_srcdir)/lib/isc LDADD += \ - libisccfgtest.la \ $(LIBISC_LIBS) \ $(LIBDNS_LIBS) \ $(LIBISCCFG_LIBS) -check_LTLIBRARIES = libisccfgtest.la -libisccfgtest_la_SOURCES = \ - ../../isc/test.c \ - ../../isc/include/isc/test.h - check_PROGRAMS = \ duration_test \ parser_test diff --git a/lib/isccfg/tests/duration_test.c b/tests/isccfg/duration_test.c similarity index 99% rename from lib/isccfg/tests/duration_test.c rename to tests/isccfg/duration_test.c index b190ce3e3f4..1fa15e32d9d 100644 --- a/lib/isccfg/tests/duration_test.c +++ b/tests/isccfg/duration_test.c @@ -34,7 +34,7 @@ #include #include -#include +#include isc_log_t *lctx = NULL; static isc_logcategory_t categories[] = { { "", 0 }, diff --git a/lib/isccfg/tests/parser_test.c b/tests/isccfg/parser_test.c similarity index 99% rename from lib/isccfg/tests/parser_test.c rename to tests/isccfg/parser_test.c index d5d5d00a751..9a524ea2ad5 100644 --- a/lib/isccfg/tests/parser_test.c +++ b/tests/isccfg/parser_test.c @@ -36,7 +36,7 @@ #include #include -#include +#include isc_log_t *lctx = NULL; static isc_logcategory_t categories[] = { { "", 0 }, diff --git a/lib/ns/test.c b/tests/ns.c similarity index 99% rename from lib/ns/test.c rename to tests/ns.c index e83e00379db..6de395b6ab1 100644 --- a/lib/ns/test.c +++ b/tests/ns.c @@ -50,7 +50,7 @@ #include #include -#include +#include dns_dispatchmgr_t *dispatchmgr = NULL; ns_clientmgr_t *clientmgr = NULL; diff --git a/lib/ns/tests/Makefile.am b/tests/ns/Makefile.am similarity index 55% rename from lib/ns/tests/Makefile.am rename to tests/ns/Makefile.am index 6a00e6d1b6b..50f87ca40a8 100644 --- a/lib/ns/tests/Makefile.am +++ b/tests/ns/Makefile.am @@ -3,23 +3,15 @@ include $(top_srcdir)/Makefile.top AM_CPPFLAGS += \ $(LIBISC_CFLAGS) \ $(LIBDNS_CFLAGS) \ - $(LIBNS_CFLAGS) + $(LIBNS_CFLAGS) \ + -I$(top_srcdir)/lib/isc \ + -I$(top_srcdir)/lib/dns LDADD += \ - libnstest.la \ $(LIBISC_LIBS) \ $(LIBDNS_LIBS) \ $(LIBNS_LIBS) -check_LTLIBRARIES = libnstest.la -libnstest_la_SOURCES = \ - ../../isc/test.c \ - ../../isc/include/isc/test.h \ - ../../dns/test.c \ - ../../dns/include/dns/test.h \ - ../../ns/test.c \ - ../../ns/include/ns/test.h - check_PROGRAMS = \ listenlist_test \ notify_test \ diff --git a/lib/ns/tests/listenlist_test.c b/tests/ns/listenlist_test.c similarity index 99% rename from lib/ns/tests/listenlist_test.c rename to tests/ns/listenlist_test.c index 353fac22e7b..565b943f7d3 100644 --- a/lib/ns/tests/listenlist_test.c +++ b/tests/ns/listenlist_test.c @@ -33,7 +33,7 @@ #include -#include +#include static int _setup(void **state) { diff --git a/lib/ns/tests/notify_test.c b/tests/ns/notify_test.c similarity index 98% rename from lib/ns/tests/notify_test.c rename to tests/ns/notify_test.c index 57953c6a6c5..c5e3009640c 100644 --- a/lib/ns/tests/notify_test.c +++ b/tests/ns/notify_test.c @@ -37,9 +37,8 @@ #include #include -#include - -#include +#include +#include static int setup_test(void **state) { diff --git a/lib/ns/tests/plugin_test.c b/tests/ns/plugin_test.c similarity index 99% rename from lib/ns/tests/plugin_test.c rename to tests/ns/plugin_test.c index 5c2f371c2f9..6434fae3a40 100644 --- a/lib/ns/tests/plugin_test.c +++ b/tests/ns/plugin_test.c @@ -35,7 +35,7 @@ _fail(const char *const file, const int line); #include -#include +#include /*% * Structure containing parameters for run_full_path_test(). diff --git a/lib/ns/tests/query_test.c b/tests/ns/query_test.c similarity index 99% rename from lib/ns/tests/query_test.c rename to tests/ns/query_test.c index de2fb849f0e..c86d98d9ac0 100644 --- a/lib/ns/tests/query_test.c +++ b/tests/ns/query_test.c @@ -38,7 +38,7 @@ #include #include -#include +#include static int setup_test(void **state) { diff --git a/lib/ns/tests/testdata/notify/notify1.msg b/tests/ns/testdata/notify/notify1.msg similarity index 100% rename from lib/ns/tests/testdata/notify/notify1.msg rename to tests/ns/testdata/notify/notify1.msg diff --git a/lib/ns/tests/testdata/notify/zone1.db b/tests/ns/testdata/notify/zone1.db similarity index 100% rename from lib/ns/tests/testdata/notify/zone1.db rename to tests/ns/testdata/notify/zone1.db diff --git a/lib/ns/tests/testdata/query/foo.db b/tests/ns/testdata/query/foo.db similarity index 100% rename from lib/ns/tests/testdata/query/foo.db rename to tests/ns/testdata/query/foo.db diff --git a/lib/unit-test-driver.sh.in b/tests/unit-test-driver.sh.in similarity index 100% rename from lib/unit-test-driver.sh.in rename to tests/unit-test-driver.sh.in