]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move all the unit tests to /tests/<libname>/
authorOndřej Surý <ondrej@isc.org>
Tue, 3 May 2022 09:37:31 +0000 (11:37 +0200)
committerEvan Hunt <each@isc.org>
Sat, 28 May 2022 21:53:02 +0000 (14:53 -0700)
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/<foo>/test.c to /tests/<foo>.c and /lib/<foo>/include/<foo>test.h
to /tests/include/tests/<foo>.h and create a single libtest.la
convenience library in /tests/.

At the same time, move the /lib/<foo>/tests/ to /tests/<foo>/ (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/.

206 files changed:
.clang-format
.clang-format.headers
Makefile.am
Makefile.tests
configure.ac
lib/dns/Makefile.am
lib/dns/tests [new symlink]
lib/irs/Makefile.am
lib/irs/tests [new symlink]
lib/isc/Makefile.am
lib/isc/tests [new symlink]
lib/isccfg/Makefile.am
lib/isccfg/tests [new symlink]
lib/ns/Makefile.am
lib/ns/tests [new symlink]
tests/.gitignore [new file with mode: 0644]
tests/Makefile.am [new file with mode: 0644]
tests/dns.c [moved from lib/dns/test.c with 99% similarity]
tests/dns/.gitignore [moved from lib/dns/tests/.gitignore with 100% similarity]
tests/dns/Kdh.+002+18602.key [moved from lib/dns/tests/Kdh.+002+18602.key with 100% similarity]
tests/dns/Krsa.+005+29235.key [moved from lib/dns/tests/Krsa.+005+29235.key with 100% similarity]
tests/dns/Makefile.am [moved from lib/dns/tests/Makefile.am with 89% similarity]
tests/dns/acl_test.c [moved from lib/dns/tests/acl_test.c with 99% similarity]
tests/dns/comparekeys/Kexample-d.+008+53461.key [moved from lib/dns/tests/comparekeys/Kexample-d.+008+53461.key with 100% similarity]
tests/dns/comparekeys/Kexample-d.+008+53461.private [moved from lib/dns/tests/comparekeys/Kexample-d.+008+53461.private with 100% similarity]
tests/dns/comparekeys/Kexample-e.+008+53973.key [moved from lib/dns/tests/comparekeys/Kexample-e.+008+53973.key with 100% similarity]
tests/dns/comparekeys/Kexample-e.+008+53973.private [moved from lib/dns/tests/comparekeys/Kexample-e.+008+53973.private with 100% similarity]
tests/dns/comparekeys/Kexample-n.+008+37464.key [moved from lib/dns/tests/comparekeys/Kexample-n.+008+37464.key with 100% similarity]
tests/dns/comparekeys/Kexample-n.+008+37464.private [moved from lib/dns/tests/comparekeys/Kexample-n.+008+37464.private with 100% similarity]
tests/dns/comparekeys/Kexample-p.+008+53461.key [moved from lib/dns/tests/comparekeys/Kexample-p.+008+53461.key with 100% similarity]
tests/dns/comparekeys/Kexample-p.+008+53461.private [moved from lib/dns/tests/comparekeys/Kexample-p.+008+53461.private with 100% similarity]
tests/dns/comparekeys/Kexample-private.+002+65316.key [moved from lib/dns/tests/comparekeys/Kexample-private.+002+65316.key with 100% similarity]
tests/dns/comparekeys/Kexample-private.+002+65316.private [moved from lib/dns/tests/comparekeys/Kexample-private.+002+65316.private with 100% similarity]
tests/dns/comparekeys/Kexample-q.+008+53461.key [moved from lib/dns/tests/comparekeys/Kexample-q.+008+53461.key with 100% similarity]
tests/dns/comparekeys/Kexample-q.+008+53461.private [moved from lib/dns/tests/comparekeys/Kexample-q.+008+53461.private with 100% similarity]
tests/dns/comparekeys/Kexample.+002+65316.key [moved from lib/dns/tests/comparekeys/Kexample.+002+65316.key with 100% similarity]
tests/dns/comparekeys/Kexample.+002+65316.private [moved from lib/dns/tests/comparekeys/Kexample.+002+65316.private with 100% similarity]
tests/dns/comparekeys/Kexample.+008+53461.key [moved from lib/dns/tests/comparekeys/Kexample.+008+53461.key with 100% similarity]
tests/dns/comparekeys/Kexample.+008+53461.private [moved from lib/dns/tests/comparekeys/Kexample.+008+53461.private with 100% similarity]
tests/dns/comparekeys/Kexample.+013+19786.key [moved from lib/dns/tests/comparekeys/Kexample.+013+19786.key with 100% similarity]
tests/dns/comparekeys/Kexample.+013+19786.private [moved from lib/dns/tests/comparekeys/Kexample.+013+19786.private with 100% similarity]
tests/dns/comparekeys/Kexample.+015+63663.key [moved from lib/dns/tests/comparekeys/Kexample.+015+63663.key with 100% similarity]
tests/dns/comparekeys/Kexample.+015+63663.private [moved from lib/dns/tests/comparekeys/Kexample.+015+63663.private with 100% similarity]
tests/dns/comparekeys/Kexample2.+002+19823.key [moved from lib/dns/tests/comparekeys/Kexample2.+002+19823.key with 100% similarity]
tests/dns/comparekeys/Kexample2.+002+19823.private [moved from lib/dns/tests/comparekeys/Kexample2.+002+19823.private with 100% similarity]
tests/dns/comparekeys/Kexample2.+008+37993.key [moved from lib/dns/tests/comparekeys/Kexample2.+008+37993.key with 100% similarity]
tests/dns/comparekeys/Kexample2.+008+37993.private [moved from lib/dns/tests/comparekeys/Kexample2.+008+37993.private with 100% similarity]
tests/dns/comparekeys/Kexample2.+013+16384.key [moved from lib/dns/tests/comparekeys/Kexample2.+013+16384.key with 100% similarity]
tests/dns/comparekeys/Kexample2.+013+16384.private [moved from lib/dns/tests/comparekeys/Kexample2.+013+16384.private with 100% similarity]
tests/dns/comparekeys/Kexample2.+015+37529.key [moved from lib/dns/tests/comparekeys/Kexample2.+015+37529.key with 100% similarity]
tests/dns/comparekeys/Kexample2.+015+37529.private [moved from lib/dns/tests/comparekeys/Kexample2.+015+37529.private with 100% similarity]
tests/dns/comparekeys/Kexample3.+002+17187.key [moved from lib/dns/tests/comparekeys/Kexample3.+002+17187.key with 100% similarity]
tests/dns/comparekeys/Kexample3.+002+17187.private [moved from lib/dns/tests/comparekeys/Kexample3.+002+17187.private with 100% similarity]
tests/dns/db_test.c [moved from lib/dns/tests/db_test.c with 99% similarity]
tests/dns/dbdiff_test.c [moved from lib/dns/tests/dbdiff_test.c with 99% similarity]
tests/dns/dbiterator_test.c [moved from lib/dns/tests/dbiterator_test.c with 99% similarity]
tests/dns/dbversion_test.c [moved from lib/dns/tests/dbversion_test.c with 99% similarity]
tests/dns/dh_test.c [moved from lib/dns/tests/dh_test.c with 97% similarity]
tests/dns/dispatch_test.c [moved from lib/dns/tests/dispatch_test.c with 99% similarity]
tests/dns/dns64_test.c [moved from lib/dns/tests/dns64_test.c with 99% similarity]
tests/dns/dnstap_test.c [moved from lib/dns/tests/dnstap_test.c with 97% similarity]
tests/dns/dst_test.c [moved from lib/dns/tests/dst_test.c with 99% similarity]
tests/dns/geoip_test.c [moved from lib/dns/tests/geoip_test.c with 98% similarity]
tests/dns/keytable_test.c [moved from lib/dns/tests/keytable_test.c with 99% similarity]
tests/dns/master_test.c [moved from lib/dns/tests/master_test.c with 99% similarity]
tests/dns/mkraw.pl [moved from lib/dns/tests/mkraw.pl with 100% similarity]
tests/dns/name_test.c [moved from lib/dns/tests/name_test.c with 99% similarity]
tests/dns/nsec3_test.c [moved from lib/dns/tests/nsec3_test.c with 99% similarity]
tests/dns/nsec3param_test.c [moved from lib/dns/tests/nsec3param_test.c with 99% similarity]
tests/dns/peer_test.c [moved from lib/dns/tests/peer_test.c with 99% similarity]
tests/dns/private_test.c [moved from lib/dns/tests/private_test.c with 99% similarity]
tests/dns/rbt_test.c [moved from lib/dns/tests/rbt_test.c with 99% similarity]
tests/dns/rbtdb_test.c [moved from lib/dns/tests/rbtdb_test.c with 98% similarity]
tests/dns/rdata_test.c [moved from lib/dns/tests/rdata_test.c with 99% similarity]
tests/dns/rdataset_test.c [moved from lib/dns/tests/rdataset_test.c with 99% similarity]
tests/dns/rdatasetstats_test.c [moved from lib/dns/tests/rdatasetstats_test.c with 99% similarity]
tests/dns/resolver_test.c [moved from lib/dns/tests/resolver_test.c with 99% similarity]
tests/dns/rsa_test.c [moved from lib/dns/tests/rsa_test.c with 99% similarity]
tests/dns/sigs_test.c [moved from lib/dns/tests/sigs_test.c with 99% similarity]
tests/dns/testdata/db/data.db [moved from lib/dns/tests/testdata/db/data.db with 100% similarity]
tests/dns/testdata/dbiterator/zone1.data [moved from lib/dns/tests/testdata/dbiterator/zone1.data with 100% similarity]
tests/dns/testdata/dbiterator/zone2.data [moved from lib/dns/tests/testdata/dbiterator/zone2.data with 100% similarity]
tests/dns/testdata/diff/zone1.data [moved from lib/dns/tests/testdata/diff/zone1.data with 100% similarity]
tests/dns/testdata/diff/zone2.data [moved from lib/dns/tests/testdata/diff/zone2.data with 100% similarity]
tests/dns/testdata/diff/zone3.data [moved from lib/dns/tests/testdata/diff/zone3.data with 100% similarity]
tests/dns/testdata/dnstap/dnstap.saved [moved from lib/dns/tests/testdata/dnstap/dnstap.saved with 100% similarity]
tests/dns/testdata/dnstap/dnstap.text [moved from lib/dns/tests/testdata/dnstap/dnstap.text with 100% similarity]
tests/dns/testdata/dnstap/query.auth [moved from lib/dns/tests/testdata/dnstap/query.auth with 100% similarity]
tests/dns/testdata/dnstap/query.recursive [moved from lib/dns/tests/testdata/dnstap/query.recursive with 100% similarity]
tests/dns/testdata/dnstap/response.auth [moved from lib/dns/tests/testdata/dnstap/response.auth with 100% similarity]
tests/dns/testdata/dnstap/response.recursive [moved from lib/dns/tests/testdata/dnstap/response.recursive with 100% similarity]
tests/dns/testdata/dst/Ktest.+008+11349.key [moved from lib/dns/tests/testdata/dst/Ktest.+008+11349.key with 100% similarity]
tests/dns/testdata/dst/Ktest.+008+11349.private [moved from lib/dns/tests/testdata/dst/Ktest.+008+11349.private with 100% similarity]
tests/dns/testdata/dst/Ktest.+013+49130.key [moved from lib/dns/tests/testdata/dst/Ktest.+013+49130.key with 100% similarity]
tests/dns/testdata/dst/Ktest.+013+49130.private [moved from lib/dns/tests/testdata/dst/Ktest.+013+49130.private with 100% similarity]
tests/dns/testdata/dst/test1.data [moved from lib/dns/tests/testdata/dst/test1.data with 100% similarity]
tests/dns/testdata/dst/test1.ecdsa256sig [moved from lib/dns/tests/testdata/dst/test1.ecdsa256sig with 100% similarity]
tests/dns/testdata/dst/test1.rsasha256sig [moved from lib/dns/tests/testdata/dst/test1.rsasha256sig with 100% similarity]
tests/dns/testdata/dst/test2.data [moved from lib/dns/tests/testdata/dst/test2.data with 100% similarity]
tests/dns/testdata/dstrandom/random.data [moved from lib/dns/tests/testdata/dstrandom/random.data with 100% similarity]
tests/dns/testdata/master/.gitignore [moved from lib/dns/tests/testdata/master/.gitignore with 100% similarity]
tests/dns/testdata/master/master1.data [moved from lib/dns/tests/testdata/master/master1.data with 100% similarity]
tests/dns/testdata/master/master10.data [moved from lib/dns/tests/testdata/master/master10.data with 100% similarity]
tests/dns/testdata/master/master11.data [moved from lib/dns/tests/testdata/master/master11.data with 100% similarity]
tests/dns/testdata/master/master12.data.in [moved from lib/dns/tests/testdata/master/master12.data.in with 100% similarity]
tests/dns/testdata/master/master13.data.in [moved from lib/dns/tests/testdata/master/master13.data.in with 100% similarity]
tests/dns/testdata/master/master14.data.in [moved from lib/dns/tests/testdata/master/master14.data.in with 100% similarity]
tests/dns/testdata/master/master15.data [moved from lib/dns/tests/testdata/master/master15.data with 100% similarity]
tests/dns/testdata/master/master16.data [moved from lib/dns/tests/testdata/master/master16.data with 100% similarity]
tests/dns/testdata/master/master17.data [moved from lib/dns/tests/testdata/master/master17.data with 100% similarity]
tests/dns/testdata/master/master18.data [moved from lib/dns/tests/testdata/master/master18.data with 100% similarity]
tests/dns/testdata/master/master2.data [moved from lib/dns/tests/testdata/master/master2.data with 100% similarity]
tests/dns/testdata/master/master3.data [moved from lib/dns/tests/testdata/master/master3.data with 100% similarity]
tests/dns/testdata/master/master4.data [moved from lib/dns/tests/testdata/master/master4.data with 100% similarity]
tests/dns/testdata/master/master5.data [moved from lib/dns/tests/testdata/master/master5.data with 100% similarity]
tests/dns/testdata/master/master6.data [moved from lib/dns/tests/testdata/master/master6.data with 100% similarity]
tests/dns/testdata/master/master7.data [moved from lib/dns/tests/testdata/master/master7.data with 100% similarity]
tests/dns/testdata/master/master8.data [moved from lib/dns/tests/testdata/master/master8.data with 100% similarity]
tests/dns/testdata/master/master9.data [moved from lib/dns/tests/testdata/master/master9.data with 100% similarity]
tests/dns/testdata/nsec3/1024.db [moved from lib/dns/tests/testdata/nsec3/1024.db with 100% similarity]
tests/dns/testdata/nsec3/2048.db [moved from lib/dns/tests/testdata/nsec3/2048.db with 100% similarity]
tests/dns/testdata/nsec3/4096.db [moved from lib/dns/tests/testdata/nsec3/4096.db with 100% similarity]
tests/dns/testdata/nsec3/min-1024.db [moved from lib/dns/tests/testdata/nsec3/min-1024.db with 100% similarity]
tests/dns/testdata/nsec3/min-2048.db [moved from lib/dns/tests/testdata/nsec3/min-2048.db with 100% similarity]
tests/dns/testdata/nsec3param/nsec3.db.signed [moved from lib/dns/tests/testdata/nsec3param/nsec3.db.signed with 100% similarity]
tests/dns/testdata/zt/zone1.db [moved from lib/dns/tests/testdata/zt/zone1.db with 100% similarity]
tests/dns/testkeys/Kexample.+008+20386.key [moved from lib/dns/tests/testkeys/Kexample.+008+20386.key with 100% similarity]
tests/dns/testkeys/Kexample.+008+20386.private [moved from lib/dns/tests/testkeys/Kexample.+008+20386.private with 100% similarity]
tests/dns/testkeys/Kexample.+008+37464.key [moved from lib/dns/tests/testkeys/Kexample.+008+37464.key with 100% similarity]
tests/dns/testkeys/Kexample.+008+37464.private [moved from lib/dns/tests/testkeys/Kexample.+008+37464.private with 100% similarity]
tests/dns/time_test.c [moved from lib/dns/tests/time_test.c with 99% similarity]
tests/dns/tsig_test.c [moved from lib/dns/tests/tsig_test.c with 99% similarity]
tests/dns/update_test.c [moved from lib/dns/tests/update_test.c with 99% similarity]
tests/dns/zonemgr_test.c [moved from lib/dns/tests/zonemgr_test.c with 99% similarity]
tests/dns/zt_test.c [moved from lib/dns/tests/zt_test.c with 99% similarity]
tests/include/tests/.clang-format [new symlink]
tests/include/tests/dns.h [moved from lib/dns/include/dns/test.h with 99% similarity]
tests/include/tests/isc.h [moved from lib/isc/include/isc/test.h with 98% similarity]
tests/include/tests/ns.h [moved from lib/ns/include/ns/test.h with 99% similarity]
tests/irs/Makefile.am [moved from lib/irs/tests/Makefile.am with 100% similarity]
tests/irs/resconf_test.c [moved from lib/irs/tests/resconf_test.c with 100% similarity]
tests/irs/testdata/domain.conf [moved from lib/irs/tests/testdata/domain.conf with 100% similarity]
tests/irs/testdata/nameserver-v4.conf [moved from lib/irs/tests/testdata/nameserver-v4.conf with 100% similarity]
tests/irs/testdata/nameserver-v6-scoped.conf [moved from lib/irs/tests/testdata/nameserver-v6-scoped.conf with 100% similarity]
tests/irs/testdata/nameserver-v6.conf [moved from lib/irs/tests/testdata/nameserver-v6.conf with 100% similarity]
tests/irs/testdata/options-attempts.conf [moved from lib/irs/tests/testdata/options-attempts.conf with 100% similarity]
tests/irs/testdata/options-bad-ndots.conf [moved from lib/irs/tests/testdata/options-bad-ndots.conf with 100% similarity]
tests/irs/testdata/options-debug.conf [moved from lib/irs/tests/testdata/options-debug.conf with 100% similarity]
tests/irs/testdata/options-empty.conf [moved from lib/irs/tests/testdata/options-empty.conf with 100% similarity]
tests/irs/testdata/options-ndots.conf [moved from lib/irs/tests/testdata/options-ndots.conf with 100% similarity]
tests/irs/testdata/options-timeout.conf [moved from lib/irs/tests/testdata/options-timeout.conf with 100% similarity]
tests/irs/testdata/options-unknown.conf [moved from lib/irs/tests/testdata/options-unknown.conf with 100% similarity]
tests/irs/testdata/options.conf [moved from lib/irs/tests/testdata/options.conf with 100% similarity]
tests/irs/testdata/port.conf [moved from lib/irs/tests/testdata/port.conf with 100% similarity]
tests/irs/testdata/resolv.conf [moved from lib/irs/tests/testdata/resolv.conf with 100% similarity]
tests/irs/testdata/search.conf [moved from lib/irs/tests/testdata/search.conf with 100% similarity]
tests/irs/testdata/sortlist-v4.conf [moved from lib/irs/tests/testdata/sortlist-v4.conf with 100% similarity]
tests/irs/testdata/timeout.conf [moved from lib/irs/tests/testdata/timeout.conf with 100% similarity]
tests/irs/testdata/unknown.conf [moved from lib/irs/tests/testdata/unknown.conf with 100% similarity]
tests/isc.c [moved from lib/isc/test.c with 94% similarity]
tests/isc/Makefile.am [moved from lib/isc/tests/Makefile.am with 90% similarity]
tests/isc/aes_test.c [moved from lib/isc/tests/aes_test.c with 99% similarity]
tests/isc/buffer_test.c [moved from lib/isc/tests/buffer_test.c with 99% similarity]
tests/isc/counter_test.c [moved from lib/isc/tests/counter_test.c with 98% similarity]
tests/isc/crc64_test.c [moved from lib/isc/tests/crc64_test.c with 98% similarity]
tests/isc/doh_test.c [moved from lib/isc/tests/doh_test.c with 99% similarity]
tests/isc/errno_test.c [moved from lib/isc/tests/errno_test.c with 99% similarity]
tests/isc/file_test.c [moved from lib/isc/tests/file_test.c with 99% similarity]
tests/isc/hash_test.c [moved from lib/isc/tests/hash_test.c with 98% similarity]
tests/isc/heap_test.c [moved from lib/isc/tests/heap_test.c with 98% similarity]
tests/isc/hmac_test.c [moved from lib/isc/tests/hmac_test.c with 99% similarity]
tests/isc/ht_test.c [moved from lib/isc/tests/ht_test.c with 99% similarity]
tests/isc/lex_test.c [moved from lib/isc/tests/lex_test.c with 99% similarity]
tests/isc/md_test.c [moved from lib/isc/tests/md_test.c with 99% similarity]
tests/isc/mem_test.c [moved from lib/isc/tests/mem_test.c with 99% similarity]
tests/isc/netaddr_test.c [moved from lib/isc/tests/netaddr_test.c with 99% similarity]
tests/isc/netmgr_test.c [moved from lib/isc/tests/netmgr_test.c with 99% similarity]
tests/isc/parse_test.c [moved from lib/isc/tests/parse_test.c with 98% similarity]
tests/isc/quota_test.c [moved from lib/isc/tests/quota_test.c with 99% similarity]
tests/isc/radix_test.c [moved from lib/isc/tests/radix_test.c with 98% similarity]
tests/isc/random_test.c [moved from lib/isc/tests/random_test.c with 99% similarity]
tests/isc/regex_test.c [moved from lib/isc/tests/regex_test.c with 99% similarity]
tests/isc/result_test.c [moved from lib/isc/tests/result_test.c with 98% similarity]
tests/isc/safe_test.c [moved from lib/isc/tests/safe_test.c with 98% similarity]
tests/isc/siphash_test.c [moved from lib/isc/tests/siphash_test.c with 99% similarity]
tests/isc/sockaddr_test.c [moved from lib/isc/tests/sockaddr_test.c with 99% similarity]
tests/isc/stats_test.c [moved from lib/isc/tests/stats_test.c with 99% similarity]
tests/isc/symtab_test.c [moved from lib/isc/tests/symtab_test.c with 99% similarity]
tests/isc/task_test.c [moved from lib/isc/tests/task_test.c with 99% similarity]
tests/isc/testdata/file/keep [moved from lib/isc/tests/testdata/file/keep with 100% similarity]
tests/isc/time_test.c [moved from lib/isc/tests/time_test.c with 99% similarity]
tests/isc/timer_test.c [moved from lib/isc/tests/timer_test.c with 99% similarity]
tests/isc/uv_wrap.h [moved from lib/isc/tests/uv_wrap.h with 100% similarity]
tests/isccfg/Makefile.am [moved from lib/isccfg/tests/Makefile.am with 61% similarity]
tests/isccfg/duration_test.c [moved from lib/isccfg/tests/duration_test.c with 99% similarity]
tests/isccfg/parser_test.c [moved from lib/isccfg/tests/parser_test.c with 99% similarity]
tests/ns.c [moved from lib/ns/test.c with 99% similarity]
tests/ns/Makefile.am [moved from lib/ns/tests/Makefile.am with 55% similarity]
tests/ns/listenlist_test.c [moved from lib/ns/tests/listenlist_test.c with 99% similarity]
tests/ns/notify_test.c [moved from lib/ns/tests/notify_test.c with 98% similarity]
tests/ns/plugin_test.c [moved from lib/ns/tests/plugin_test.c with 99% similarity]
tests/ns/query_test.c [moved from lib/ns/tests/query_test.c with 99% similarity]
tests/ns/testdata/notify/notify1.msg [moved from lib/ns/tests/testdata/notify/notify1.msg with 100% similarity]
tests/ns/testdata/notify/zone1.db [moved from lib/ns/tests/testdata/notify/zone1.db with 100% similarity]
tests/ns/testdata/query/foo.db [moved from lib/ns/tests/testdata/query/foo.db with 100% similarity]
tests/unit-test-driver.sh.in [moved from lib/unit-test-driver.sh.in with 100% similarity]

index 44f50b0851996052ac660505e0db9a3bd47fc20b..41a90bf5bb04ee2de1349fd90da4c7648b9cc3e1 100644 (file)
@@ -34,12 +34,6 @@ PointerAlignment: Right
 PointerBindsToType: false
 IncludeBlocks: Regroup
 IncludeCategories:
-  - Regex:           '^<isc/test.h>$'
-    Priority:        100
-  - Regex:           '^<dns/test.h>$'
-    Priority:        101
-  - Regex:           '^<ns/test.h>$'
-    Priority:        102
   - Regex:           '^<isc/'
     Priority:        5
   - Regex:           '^<(pk11|pkcs11)/'
@@ -64,6 +58,8 @@ IncludeCategories:
     Priority:        55
   - Regex:           '^".*"'
     Priority:        99
+  - Regex:           '^<tests/'
+    Priority:        100
   - Regex:           '<openssl/'
     Priority:        1
   - Regex:           '<(mysql|protobuf-c)/'
index baebcba70f01d57c0c0c2ebeaa771b4827ffc884..1306bb21489e39b20695df12dd91c9156875621c 100644 (file)
@@ -34,12 +34,6 @@ PointerAlignment: Right
 PointerBindsToType: false
 IncludeBlocks: Regroup
 IncludeCategories:
-  - Regex:           '^<isc/test.h>$'
-    Priority:        100
-  - Regex:           '^<dns/test.h>$'
-    Priority:        101
-  - Regex:           '^<ns/test.h>$'
-    Priority:        102
   - Regex:           '^<isc/'
     Priority:        2
   - Regex:           '^<dns/'
@@ -54,6 +48,8 @@ IncludeCategories:
     Priority:        7
   - Regex:           '^(<[^/]*)/)'
     Priority:        8
+  - Regex:           '^<tests/'
+    Priority:        10
   - Regex:           '<[[:alnum:].]+>'
     Priority:        1
   - Regex:           '".*"'
index f2005cfab78436159e77c055202e4cbe3d2d80b7..2f095616591de8a7e86b119422c47485bb08cdb4 100644 (file)
@@ -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                 \
index 7ae2c5ada12efe29dd8570e8200885bf4ad70e0b..d7b2e948e0f66b2362796837ea6153deaa94161e 100644 (file)
@@ -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)
index 7b284ef6dae43732a9105c118b3b12843ac57f96..b6b546e6c4285e34511784b1f06716e34ea9aa5b 100644 (file)
@@ -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
 
index cf49c33b3885bf5436659c80b8e18e11454bd767..35602b225978bf8a5a91d91115903ebd3d6066c5 100644 (file)
@@ -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 (symlink)
index 0000000..e4acc10
--- /dev/null
@@ -0,0 +1 @@
+../../tests/dns
\ No newline at end of file
index eac972b26db744a9a5e2fa6ecdf699d1d70a54ac..85c4065af3413b96c27d7db5532a383c3128706a 100644 (file)
@@ -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 (symlink)
index 0000000..247a63e
--- /dev/null
@@ -0,0 +1 @@
+../../tests/irs
\ No newline at end of file
index 16bb818f46b6c376d5da7d3c9406aefde9b83b0d..fb443b5d6e6a605f18b28cb8ece7e0b64fef180a 100644 (file)
@@ -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 (symlink)
index 0000000..9c8d7ce
--- /dev/null
@@ -0,0 +1 @@
+../../tests/isc
\ No newline at end of file
index 3205e3b93bb9ff7b5bc2db137c7b3e95761a4507..32e905aa96569eb9f76735fc4df1b221acf2d448 100644 (file)
@@ -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 (symlink)
index 0000000..1d7dfaf
--- /dev/null
@@ -0,0 +1 @@
+../../tests/isccfg
\ No newline at end of file
index b2d5d73b4cd4d1e4c89be41469b5065b4bba6920..eb86aebe1861aa773c86040b226780c0be41f121 100644 (file)
@@ -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 (symlink)
index 0000000..0ec3da8
--- /dev/null
@@ -0,0 +1 @@
+../../tests/ns
\ No newline at end of file
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644 (file)
index 0000000..78fe21f
--- /dev/null
@@ -0,0 +1 @@
+/unit-test-driver.sh
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..0a19bb1
--- /dev/null
@@ -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
similarity index 99%
rename from lib/dns/test.c
rename to tests/dns.c
index fa93486f0028b657a12c3642198d8704934d0475..bbe8ce6e43d055a8cfeb3a359a844359d7de0468 100644 (file)
@@ -53,7 +53,7 @@
 #include <dns/view.h>
 #include <dns/zone.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 dns_zonemgr_t *zonemgr = NULL;
 
similarity index 89%
rename from lib/dns/tests/Makefile.am
rename to tests/dns/Makefile.am
index 4dd04b39e435c82ce9bb55b8ce5a538dce283522..0164a4ad87895294f2757c07dc0539133458fd74 100644 (file)
@@ -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)                \
similarity index 99%
rename from lib/dns/tests/acl_test.c
rename to tests/dns/acl_test.c
index 9e3359c267578f0ef195ab34ffd2399418ec5de7..210ab45dfad39f322b03bd7d1ed6fb7bf5cda16c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <dns/acl.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define BUFLEN     255
 #define BIGBUFLEN   (70 * 1024)
similarity index 99%
rename from lib/dns/tests/db_test.c
rename to tests/dns/db_test.c
index 78988746208743e8ea791ddcca7e220295c5516b..27fcf7deea551bcf9179d91c5d4085c7c0ec744b 100644 (file)
@@ -27,7 +27,7 @@
 #include <dns/name.h>
 #include <dns/rdatalist.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define BUFLEN     255
 #define BIGBUFLEN   (64 * 1024)
similarity index 99%
rename from lib/dns/tests/dbdiff_test.c
rename to tests/dns/dbdiff_test.c
index 5f0c7dfc252d9d350e84755fd5b94995e4c8d896..12490a8dcae0c11335f673d51c068053e27d950b 100644 (file)
@@ -29,7 +29,7 @@
 #include <dns/journal.h>
 #include <dns/name.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define BUFLEN     255
 #define BIGBUFLEN   (64 * 1024)
similarity index 99%
rename from lib/dns/tests/dbiterator_test.c
rename to tests/dns/dbiterator_test.c
index 9daa4b6290ee3ac5a676a2dc8ad911136b2bd9ca..90e8536fc2cb7e5f66687a51f6b57d198906c078 100644 (file)
@@ -28,7 +28,7 @@
 #include <dns/dbiterator.h>
 #include <dns/name.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define BUFLEN     255
 #define BIGBUFLEN   (64 * 1024)
similarity index 99%
rename from lib/dns/tests/dbversion_test.c
rename to tests/dns/dbversion_test.c
index 81d52581bd3f14708e305f65dfd1065001c35fb3..8124563f49516e00c98da274a1af5db58a1f0668 100644 (file)
@@ -35,7 +35,7 @@
 #include <dns/rdataset.h>
 #include <dns/rdatasetiter.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static char tempname[11] = "dtXXXXXXXX";
 static dns_db_t *db1 = NULL, *db2 = NULL;
similarity index 97%
rename from lib/dns/tests/dh_test.c
rename to tests/dns/dh_test.c
index d1a938fb3cf547f80121ca8ebb651c31468c7836..acc7c697fce8d06c2f427212fb91a03267eab405 100644 (file)
@@ -28,9 +28,9 @@
 
 #include <dns/name.h>
 
-#include "../dst_internal.h"
+#include "dst_internal.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static int
 setup_test(void **state) {
similarity index 99%
rename from lib/dns/tests/dispatch_test.c
rename to tests/dns/dispatch_test.c
index e90edea9ccdd4392d94bc1d1e26c17582572249b..a2973308640c8eb41db147c7b21dc2df7cbceddd 100644 (file)
@@ -35,7 +35,7 @@
 #include <dns/name.h>
 #include <dns/view.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 uv_sem_t sem;
 
similarity index 99%
rename from lib/dns/tests/dns64_test.c
rename to tests/dns/dns64_test.c
index fd02504c186ce6262478feae317d90111947486b..6ca96551e604ea8c0406e06a7496f84f87d2b2dc 100644 (file)
@@ -32,7 +32,7 @@
 #include <dns/rdatalist.h>
 #include <dns/rdataset.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static void
 multiple_prefixes(void) {
similarity index 97%
rename from lib/dns/tests/dnstap_test.c
rename to tests/dns/dnstap_test.c
index 25e68c4763062b460fc69ceb0699f144e5ff5988..8fdb952a38b4686c2737ec1a4df885be4369400c 100644 (file)
 #include <dns/dnstap.h>
 #include <dns/view.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
-#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__))) {
similarity index 99%
rename from lib/dns/tests/dst_test.c
rename to tests/dns/dst_test.c
index 3073580b42f4e5ada213c947ef6ba2a31c6207ee..28bd2ec72e18454d1c2ff8fd91bdd6d0c22a2057 100644 (file)
@@ -31,9 +31,9 @@
 
 #include <dst/dst.h>
 
-#include "../dst_internal.h"
+#include "dst_internal.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static int
 setup_test(void **state) {
similarity index 98%
rename from lib/dns/tests/geoip_test.c
rename to tests/dns/geoip_test.c
index 9c7ba7d71e16d4bc979308d66a6f55facb0cf661..8af48f448c94c8d3406ea3f7839673d96ab2f9d5 100644 (file)
 
 #include <dns/geoip.h>
 
-#include "../geoip2.c"
+#include "geoip2.c"
 
-#include <dns/test.h>
-
-/* Use GeoIP2 databases from the 'geoip2' system test */
-#define TEST_GEOIP_DATA "../../../bin/tests/system/geoip2/data"
+#include <tests/dns.h>
 
 static dns_geoip_databases_t geoip;
 
similarity index 99%
rename from lib/dns/tests/keytable_test.c
rename to tests/dns/keytable_test.c
index e6aab79760e2c2f3b358f24dda301613d0310e2c..bc7b60d12e2d911e4a43b64973f675df4d49a370 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <dst/dst.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 dns_keytable_t *keytable = NULL;
 dns_ntatable_t *ntatable = NULL;
similarity index 99%
rename from lib/dns/tests/master_test.c
rename to tests/dns/master_test.c
index 755ad459a21178b39e219842fb39a42582fab345..1642b0d12e32b166a5763d4aedf1f3a67367d860 100644 (file)
@@ -38,7 +38,7 @@
 #include <dns/rdatalist.h>
 #include <dns/rdataset.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static void
 nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) {
similarity index 100%
rename from lib/dns/tests/mkraw.pl
rename to tests/dns/mkraw.pl
similarity index 99%
rename from lib/dns/tests/name_test.c
rename to tests/dns/name_test.c
index d89100e85674bda9af2520fcac6ec7abe8df2a30..511ee3c8b343813ba29bbe7d8b0ce0db1d601f75 100644 (file)
@@ -36,7 +36,7 @@
 #include <dns/fixedname.h>
 #include <dns/name.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 /* Set to true (or use -v option) for verbose output */
 static bool verbose = false;
similarity index 99%
rename from lib/dns/tests/nsec3_test.c
rename to tests/dns/nsec3_test.c
index f417bdd8c19d6d1de94b36e1b429acb40cb2c1d5..7d6e42470515dcc2b60f56f242a4ee1634397dff 100644 (file)
@@ -28,7 +28,7 @@
 #include <dns/db.h>
 #include <dns/nsec3.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static void
 iteration_test(const char *file, unsigned int expected) {
similarity index 99%
rename from lib/dns/tests/nsec3param_test.c
rename to tests/dns/nsec3param_test.c
index c2ddee3199de678b7eb1411d5e13fcf4679853cd..3bd50e59a4c7201141051829a9af4671738b3fa5 100644 (file)
@@ -30,9 +30,9 @@
 #include <dns/db.h>
 #include <dns/nsec3.h>
 
-#include "../zone_p.h"
+#include "zone_p.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define HASH   1
 #define FLAGS  0
similarity index 99%
rename from lib/dns/tests/peer_test.c
rename to tests/dns/peer_test.c
index 40eb48d1e7d123e81cc77aa45fe7e7679a162a31..32ef932d930d8ee5658c702f564b086fee073e9d 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <dns/peer.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 /* Test DSCP set/get functions */
 ISC_RUN_TEST_IMPL(dscp) {
similarity index 99%
rename from lib/dns/tests/private_test.c
rename to tests/dns/private_test.c
index db7284a6a8ccb0b43ae27ef57129fe8b7727bee3..adaf441cf415770b307e6c5789c35b1a089e04a0 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <dst/dst.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static dns_rdatatype_t privatetype = 65534;
 
similarity index 99%
rename from lib/dns/tests/rbt_test.c
rename to tests/dns/rbt_test.c
index 9b88dff287a86e4bda3621d0a1e61af64fe00bef..c66c365e59fe5e1ab068761d8401d991716024e3 100644 (file)
@@ -51,7 +51,7 @@
 
 #include <dst/dst.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 typedef struct {
        dns_rbt_t *rbt;
similarity index 98%
rename from lib/dns/tests/rbtdb_test.c
rename to tests/dns/rbtdb_test.c
index f7ac5325519162bf1a41bb648b501b4d67f939bb..817dd67e2fef649eaacf8ed27a14e460ed82af52 100644 (file)
 #include <dns/rbt.h>
 #include <dns/rdataset.h>
 #include <dns/rdatastruct.h>
-
-#include <dns/test.h>
+#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 <tests/dns.h>
+
 const char *ownercase_vectors[12][2] = {
        {
                "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz",
similarity index 99%
rename from lib/dns/tests/rdata_test.c
rename to tests/dns/rdata_test.c
index cee2e0b148eb3c9de849136df1696e446b887276..71149eafaff2e9c216f13780dfae97fdb661cf66 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <dns/rdata.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static bool debug = false;
 
similarity index 99%
rename from lib/dns/tests/rdataset_test.c
rename to tests/dns/rdataset_test.c
index 3d340cf111139f1f7f8d6f36d19fc6e1ba378145..e9b47ecbf3f379d4c61c0d761653f4a434f91c82 100644 (file)
@@ -27,7 +27,7 @@
 #include <dns/rdataset.h>
 #include <dns/rdatastruct.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 /* test trimming of rdataset TTLs */
 ISC_RUN_TEST_IMPL(trimttl) {
similarity index 99%
rename from lib/dns/tests/rdatasetstats_test.c
rename to tests/dns/rdatasetstats_test.c
index cfb9c489ad7e48b03ac69efa1ac22ae47a4fde73..743803474c3f233fa4a8f716987057351a9d2a68 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <dns/stats.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static void
 set_typestats(dns_stats_t *stats, dns_rdatatype_t type) {
similarity index 99%
rename from lib/dns/tests/resolver_test.c
rename to tests/dns/resolver_test.c
index c11c6aeff63a05d26bc6aab671393dd6dc87ff91..634dbc4a2899e7a3b3411a318f1f3c466ec37c4e 100644 (file)
@@ -34,7 +34,7 @@
 #include <dns/resolver.h>
 #include <dns/view.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static dns_dispatchmgr_t *dispatchmgr = NULL;
 static dns_dispatch_t *dispatch = NULL;
similarity index 99%
rename from lib/dns/tests/rsa_test.c
rename to tests/dns/rsa_test.c
index 0b169c3603db8c65593f5a8e4b82fd37483a2247..8b2bd8921955a30852a62ce0c621c7794c680992 100644 (file)
@@ -26,9 +26,9 @@
 #include <isc/print.h>
 #include <isc/util.h>
 
-#include "../dst_internal.h"
+#include "dst_internal.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static int
 setup_test(void **state) {
similarity index 99%
rename from lib/dns/tests/sigs_test.c
rename to tests/dns/sigs_test.c
index 135bdddef50a3c615cf663103bdcbb31062a4e9a..55183057f1cc503ad8b070eb756163df128d0821 100644 (file)
@@ -43,9 +43,9 @@
 
 #include <dst/dst.h>
 
-#include "../zone_p.h"
+#include "zone_p.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 /*%
  * Structure characterizing a single diff tuple in the dns_diff_t structure
similarity index 99%
rename from lib/dns/tests/time_test.c
rename to tests/dns/time_test.c
index c11b4b9fd40da1913037aed74a9c6d2d45a3424d..f6e19481f45d2a6041297169d646a242c606e88a 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <dns/time.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define TEST_ORIGIN "test"
 
similarity index 99%
rename from lib/dns/tests/tsig_test.c
rename to tests/dns/tsig_test.c
index dead784185ccbf375598656b67b369edc86b8d07..f94a0fa01690b4fef0198e015414a530f8ac2861 100644 (file)
@@ -30,9 +30,9 @@
 #include <dns/rdataset.h>
 #include <dns/tsig.h>
 
-#include "../tsig_p.h"
+#include "tsig_p.h"
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 #define TEST_ORIGIN "test"
 
similarity index 99%
rename from lib/dns/tests/update_test.c
rename to tests/dns/update_test.c
index 7c50192a840c8a27b7149eb984d1ea9850aa637d..afeaa5ce830cda597efc9612cbd4aaed7ece44d0 100644 (file)
@@ -29,8 +29,7 @@
 #include <isc/util.h>
 
 #include <dns/update.h>
-
-#include <dns/test.h>
+#define KEEP_BEFORE
 
 /*
  * Fix the linking order problem for overridden isc_stdtime_get() by making
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wshadow"
 #undef CHECK
-#include "../update.c"
+#include "update.c"
 #pragma GCC diagnostic pop
 
+#undef CHECK
+#include <tests/dns.h>
+
 static int
 setup_test(void **state) {
        UNUSED(state);
similarity index 99%
rename from lib/dns/tests/zonemgr_test.c
rename to tests/dns/zonemgr_test.c
index bca643887e89a8eb73053d84b1b5a887ca266092..cf1c718ba2cc8c476afdf441e351960fd4df13f9 100644 (file)
@@ -31,7 +31,7 @@
 #include <dns/view.h>
 #include <dns/zone.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 /* create zone manager */
 ISC_RUN_TEST_IMPL(dns_zonemgr_create) {
similarity index 99%
rename from lib/dns/tests/zt_test.c
rename to tests/dns/zt_test.c
index 981831349c3f7b5ff2cfa0a476caa5bc50179af8..74cbe059a23b31af2d47980031bb0d2c79d7af0d 100644 (file)
@@ -37,7 +37,7 @@
 #include <dns/zone.h>
 #include <dns/zt.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 static int
 _setup(void **state) {
diff --git a/tests/include/tests/.clang-format b/tests/include/tests/.clang-format
new file mode 120000 (symlink)
index 0000000..0e62f72
--- /dev/null
@@ -0,0 +1 @@
+../../../.clang-format.headers
\ No newline at end of file
similarity index 99%
rename from lib/dns/include/dns/test.h
rename to tests/include/tests/dns.h
index e4e3e7c29235c58b51ebecb8be878a8a97b4f0f8..64a265b6609e157941e4b2d2499c6a332b525cc3 100644 (file)
@@ -32,7 +32,7 @@
 #include <dns/diff.h>
 #include <dns/zone.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 extern dns_zonemgr_t *zonemgr;
 
similarity index 98%
rename from lib/isc/include/isc/test.h
rename to tests/include/tests/isc.h
index 14f464ef24abf83d0cda04a38485a1a8431a5b0e..38dadb46791e321d167114fe212a52dc61219aa9 100644 (file)
@@ -31,9 +31,9 @@
 #include <isc/timer.h>
 #include <isc/util.h>
 
-#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 {                                 \
similarity index 99%
rename from lib/ns/include/ns/test.h
rename to tests/include/tests/ns.h
index 3b5fec1a862e18c798f2496bd55609d2217f094f..2317e7daee2e05dcd3af227d90f06e57325d6000 100644 (file)
@@ -34,7 +34,7 @@
 #include <ns/hooks.h>
 #include <ns/interfacemgr.h>
 
-#include <dns/test.h>
+#include <tests/dns.h>
 
 typedef struct ns_test_id {
        const char *description;
similarity index 94%
rename from lib/isc/test.c
rename to tests/isc.c
index bcdda1eefdcea549c3e65da158ddc5fca1ad7741..61e29c2a34666b621eb324a9bf3ff05b6211267b 100644 (file)
 #include <isc/timer.h>
 #include <isc/util.h>
 
-#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 <isc/test.h>
+#include <tests/isc.h>
 
 isc_mem_t *mctx = NULL;
 isc_taskmgr_t *taskmgr = NULL;
similarity index 90%
rename from lib/isc/tests/Makefile.am
rename to tests/isc/Makefile.am
index 8ea6da0d298f3221eee9762924c2bc785f285b30..6ce570c88213a985c3e8f547c966ef6625577960 100644 (file)
@@ -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     \
similarity index 99%
rename from lib/isc/tests/aes_test.c
rename to tests/isc/aes_test.c
index 8cc9d90defdca5725184ca1db151a84a81d77d29..c328b92b02dba5ecbdcda04e7812590ec90b053e 100644 (file)
@@ -29,7 +29,7 @@
 #include <isc/string.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /*
  * Test data from NIST KAT
similarity index 99%
rename from lib/isc/tests/buffer_test.c
rename to tests/isc/buffer_test.c
index 43317ca46a338279d79d4319ce58f3c70ac4f892..8335248fa00d73a73fcab5d28ddc7c69c0cefa5b 100644 (file)
@@ -32,7 +32,7 @@
 #include <isc/types.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* reserve space in dynamic buffers */
 ISC_RUN_TEST_IMPL(isc_buffer_reserve) {
similarity index 98%
rename from lib/isc/tests/counter_test.c
rename to tests/isc/counter_test.c
index d32390849a84f514a33fd57372a2d8eafc751215..065a6f0a3bf7973e3b06dbfb5c63a5d2debe01f4 100644 (file)
@@ -25,7 +25,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test isc_counter object */
 ISC_RUN_TEST_IMPL(isc_counter) {
similarity index 98%
rename from lib/isc/tests/crc64_test.c
rename to tests/isc/crc64_test.c
index d6253d6a54677e8c5834b442855b3221d4909c31..9b8ff47b9e06cd87daacfd5d2487e3bc8041c883 100644 (file)
@@ -28,7 +28,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define TEST_INPUT(x) (x), sizeof(x) - 1
 
similarity index 99%
rename from lib/isc/tests/doh_test.c
rename to tests/isc/doh_test.c
index 244fc6a07edb01b6051c45cd90490ff7769eeaea..b8c5d1f81f5b46a0dba26bcc1b59514e5bc91a87 100644 (file)
 #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 <isc/test.h>
+#include <tests/isc.h>
 
 #define MAX_NM 2
 
similarity index 99%
rename from lib/isc/tests/errno_test.c
rename to tests/isc/errno_test.c
index c5ddbcb366b07a6a0e1d5432fcd81590401132d5..11d48fa8f58e28380b2a3902476ddfaa365bcafd 100644 (file)
@@ -26,7 +26,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 typedef struct {
        int err;
similarity index 99%
rename from lib/isc/tests/file_test.c
rename to tests/isc/file_test.c
index 7333fa8a0a069454cefc3c9e6c65b22bf73639ee..39670b57eb848e8fcfe8fec9ec17c011d4c49bc4 100644 (file)
@@ -27,7 +27,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define NAME     "internal"
 #define SHA      "3bed2cb3a3acf7b6a8ef408420cc682d5520e26976d354254f528c965612054f"
similarity index 98%
rename from lib/isc/tests/hash_test.c
rename to tests/isc/hash_test.c
index 4c6f020eb01c450e77c4e67b10c6f9bb3b4a76cc..10a8c27e5864f9c1f09370f47fb18e7eb21d21ad 100644 (file)
@@ -32,7 +32,7 @@
 #include <isc/string.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* Hash function test */
 ISC_RUN_TEST_IMPL(isc_hash_function) {
similarity index 98%
rename from lib/isc/tests/heap_test.c
rename to tests/isc/heap_test.c
index 0281afb0411eea13380e1fa139c935c8162fccc0..9e29a4b812329d5b916855cef988c31acce81945 100644 (file)
@@ -27,7 +27,7 @@
 #include <isc/mem.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 struct e {
        unsigned int value;
similarity index 99%
rename from lib/isc/tests/hmac_test.c
rename to tests/isc/hmac_test.c
index a6834766f9181b836eb20ad3a8756c29e7656eff..ac567d68846bf70c003bd527b9455e25a05ae564 100644 (file)
@@ -29,9 +29,9 @@
 #include <isc/region.h>
 #include <isc/result.h>
 
-#include "../hmac.c"
+#include "hmac.c"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define TEST_INPUT(x) (x), sizeof(x) - 1
 
similarity index 99%
rename from lib/isc/tests/ht_test.c
rename to tests/isc/ht_test.c
index d1b138cb24434cff4bf26deef015d239f2845079..152994e47dbfe205eb8d1fd8b2ec436ca2d78e29 100644 (file)
 #include <isc/string.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* INCLUDE LAST */
 
 #define mctx __mctx
-#include "../ht.c"
+#include "ht.c"
 #undef mctx
 
 static void
similarity index 99%
rename from lib/isc/tests/lex_test.c
rename to tests/isc/lex_test.c
index f792f6d131e71736a3308e38d2159760ede55124..cf6bfe2ea54d1cbffa6af81537694c6b6616bec3 100644 (file)
@@ -27,7 +27,7 @@
 #include <isc/mem.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define AS_STR(x) (x).value.as_textregion.base
 
similarity index 99%
rename from lib/isc/tests/md_test.c
rename to tests/isc/md_test.c
index 5f8eb74a52079b2afdd547122c090b9ba443fa05..d7d154c13b18eaa59a31488bc130b53ade7845d0 100644 (file)
@@ -29,9 +29,9 @@
 #include <isc/region.h>
 #include <isc/result.h>
 
-#include "../md.c"
+#include "md.c"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define TEST_INPUT(x) (x), sizeof(x) - 1
 
similarity index 99%
rename from lib/isc/tests/mem_test.c
rename to tests/isc/mem_test.c
index e3d838dc2624a0e39018ffca64bfad4649a7e930..f2bbdbd3f47ebf56fc338851ff87237199c0c5a0 100644 (file)
@@ -35,9 +35,9 @@
 #include <isc/time.h>
 #include <isc/util.h>
 
-#include "../mem_p.h"
+#include "mem_p.h"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define MP1_FREEMAX  10
 #define MP1_FILLCNT  10
similarity index 99%
rename from lib/isc/tests/netaddr_test.c
rename to tests/isc/netaddr_test.c
index 924c55e67ceac166e4230482d017dddce266730d..b44982c26b0a1bca9b8ed702f0d0b640109effd6 100644 (file)
@@ -27,7 +27,7 @@
 #include <isc/sockaddr.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test isc_netaddr_isnetzero() */
 ISC_RUN_TEST_IMPL(netaddr_isnetzero) {
similarity index 99%
rename from lib/isc/tests/netmgr_test.c
rename to tests/isc/netmgr_test.c
index e71131f26f221844cd5617822f45e123b0fe55c8..1bd5d6881955f5c3b1ee8e2aaaf2212f43d37728 100644 (file)
 
 #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 <isc/test.h>
+#include <tests/isc.h>
 
 typedef void (*stream_connect_function)(isc_nm_t *nm);
 
similarity index 98%
rename from lib/isc/tests/parse_test.c
rename to tests/isc/parse_test.c
index e250a37eec4f2dfdffef5004d0c991682db74c1c..a5b516a0271ed130a087be669590875fe91b1839 100644 (file)
@@ -29,7 +29,7 @@
 #include <isc/parseint.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* Test for 32 bit overflow on 64 bit machines in isc_parse_uint32 */
 ISC_RUN_TEST_IMPL(parse_overflow) {
similarity index 99%
rename from lib/isc/tests/quota_test.c
rename to tests/isc/quota_test.c
index 611f36f5c0936d0dbc0fc4c5f27932adccf2aaf8..d4ae843a4a402ad652bd2655db7a98164ae56caa 100644 (file)
@@ -19,7 +19,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <uv.h>
 
 #define UNIT_TESTING
 #include <cmocka.h>
@@ -28,8 +27,9 @@
 #include <isc/result.h>
 #include <isc/thread.h>
 #include <isc/util.h>
+#include <isc/uv.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 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(&quota);
        return ((isc_threadresult_t)0);
 }
similarity index 98%
rename from lib/isc/tests/radix_test.c
rename to tests/isc/radix_test.c
index 642eafb54221ba1a1362924e0746e578a4660657..2fe9294d697668251ec0b90f6741c0c21e218b2e 100644 (file)
@@ -27,7 +27,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test radix searching */
 ISC_RUN_TEST_IMPL(isc_radix_search) {
similarity index 99%
rename from lib/isc/tests/random_test.c
rename to tests/isc/random_test.c
index af200085ce080f2ef631d0ac79ddbd2f52b3faff..8c41e9713826777ddb60bd2f1ba27cd16cf08a77 100644 (file)
@@ -38,7 +38,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define REPS 25000
 
similarity index 99%
rename from lib/isc/tests/regex_test.c
rename to tests/isc/regex_test.c
index 6336d76ab0939e99e91e4f149a5ba93b1a5766d9..dd44d3bc8992abb9eaefc86eab699ca72a201df7 100644 (file)
@@ -32,7 +32,7 @@
 #include <isc/regex.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test isc_regex_validate() */
 ISC_RUN_TEST_IMPL(regex_validate) {
similarity index 98%
rename from lib/isc/tests/result_test.c
rename to tests/isc/result_test.c
index 319172a4aff5630f0dc1c0b4b64cd86adbda34cd..cca66b85d610f3cd955131792456876d51f9515c 100644 (file)
@@ -25,7 +25,7 @@
 #include <isc/result.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* convert result to identifier string */
 ISC_RUN_TEST_IMPL(isc_result_toid) {
similarity index 98%
rename from lib/isc/tests/safe_test.c
rename to tests/isc/safe_test.c
index 7428f824a24cb6d529eeade6e96e206ca8c9be4f..39221649c2253552f7913b17307ad59894db29a6 100644 (file)
@@ -26,7 +26,7 @@
 #include <isc/safe.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test isc_safe_memequal() */
 ISC_RUN_TEST_IMPL(isc_safe_memequal) {
similarity index 99%
rename from lib/isc/tests/siphash_test.c
rename to tests/isc/siphash_test.c
index f7d14a470ec2e11324770693311cc9fab880ba89..5480afd79191476965b7e91d709224e6f97cf988 100644 (file)
@@ -23,9 +23,9 @@
 
 #include <isc/siphash.h>
 
-#include "../siphash.c"
+#include "siphash.c"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 const uint8_t vectors_sip64[64][8] = {
        { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72 },
similarity index 99%
rename from lib/isc/tests/sockaddr_test.c
rename to tests/isc/sockaddr_test.c
index b5f1568a1a75b0b933c786eafbc9433d7b5fb312..126bfa9fe40736f305ec3dad6e608e13a5d94b6c 100644 (file)
@@ -28,7 +28,7 @@
 #include <isc/sockaddr.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test sockaddr hash */
 ISC_RUN_TEST_IMPL(sockaddr_hash) {
similarity index 99%
rename from lib/isc/tests/stats_test.c
rename to tests/isc/stats_test.c
index dd35ba1e60a0c4a439a2aee38294c2303e40009d..79d784e2df8963f025e2cbcff88b6433cd7ca2ce 100644 (file)
@@ -26,7 +26,7 @@
 #include <isc/stats.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* test stats */
 ISC_RUN_TEST_IMPL(isc_stats_basic) {
similarity index 99%
rename from lib/isc/tests/symtab_test.c
rename to tests/isc/symtab_test.c
index 193b08d5b79c10e5c8dd21b17aae72d59813999b..bcbc0c43bb21ced94d445cd93efe749bfea22bae 100644 (file)
@@ -26,7 +26,7 @@
 #include <isc/symtab.h>
 #include <isc/util.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 static void
 undefine(char *key, unsigned int type, isc_symvalue_t value, void *arg) {
similarity index 99%
rename from lib/isc/tests/task_test.c
rename to tests/isc/task_test.c
index 9b60ec16cb97de25b0ca81ab022afbc8dee95398..f7a20786d71230a6685c26d79b8fb545a1ca451d 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <uv.h>
 
 #define UNIT_TESTING
 
@@ -37,8 +36,9 @@
 #include <isc/time.h>
 #include <isc/timer.h>
 #include <isc/util.h>
+#include <isc/uv.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* 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);
        }
 }
 
similarity index 99%
rename from lib/isc/tests/time_test.c
rename to tests/isc/time_test.c
index 9649b831719d617de499289e62d7046318823674..4b355a700305014b414f3c51ef0bb21b7a14dfe4 100644 (file)
@@ -26,9 +26,9 @@
 #include <isc/time.h>
 #include <isc/util.h>
 
-#include "../time.c"
+#include "time.c"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 #define NS_PER_S 1000000000 /*%< Nanoseconds per second. */
 #define MAX_NS  (NS_PER_S - 1)
similarity index 99%
rename from lib/isc/tests/timer_test.c
rename to tests/isc/timer_test.c
index f61438b36ef9e19a5f2de5b39b24ddf11d1f29e2..eeea65137104f3b260b93b2c9be59a9738fc561c 100644 (file)
@@ -19,7 +19,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <uv.h>
 
 #define UNIT_TESTING
 #include <cmocka.h>
 #include <isc/time.h>
 #include <isc/timer.h>
 #include <isc/util.h>
+#include <isc/uv.h>
 
-#include "../timer.c"
+#include "timer.c"
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 /* 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);
similarity index 100%
rename from lib/isc/tests/uv_wrap.h
rename to tests/isc/uv_wrap.h
similarity index 61%
rename from lib/isccfg/tests/Makefile.am
rename to tests/isccfg/Makefile.am
index 9ccddfab5bf1b388497520340029ba08a18e7ce8..73655a5401235e089d83b4459100cad9e620bb48 100644 (file)
@@ -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
similarity index 99%
rename from lib/isccfg/tests/duration_test.c
rename to tests/isccfg/duration_test.c
index b190ce3e3f4dee2459ee60897d6c1dc43bf4a4dc..1fa15e32d9d39b11edfb49655c6bab3646cb911e 100644 (file)
@@ -34,7 +34,7 @@
 #include <isccfg/grammar.h>
 #include <isccfg/namedconf.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 isc_log_t *lctx = NULL;
 static isc_logcategory_t categories[] = { { "", 0 },
similarity index 99%
rename from lib/isccfg/tests/parser_test.c
rename to tests/isccfg/parser_test.c
index d5d5d00a75102637efe70baff9c4de680109a76a..9a524ea2ad5862c09a1140aa15fb720bf0f446f8 100644 (file)
@@ -36,7 +36,7 @@
 #include <isccfg/grammar.h>
 #include <isccfg/namedconf.h>
 
-#include <isc/test.h>
+#include <tests/isc.h>
 
 isc_log_t *lctx = NULL;
 static isc_logcategory_t categories[] = { { "", 0 },
similarity index 99%
rename from lib/ns/test.c
rename to tests/ns.c
index e83e00379db2463e9783299cc197adf72e0eb325..6de395b6ab103e9e9bcf7294c013b6dc5f215e6e 100644 (file)
@@ -50,7 +50,7 @@
 #include <ns/interfacemgr.h>
 #include <ns/server.h>
 
-#include <ns/test.h>
+#include <tests/ns.h>
 
 dns_dispatchmgr_t *dispatchmgr = NULL;
 ns_clientmgr_t *clientmgr = NULL;
similarity index 55%
rename from lib/ns/tests/Makefile.am
rename to tests/ns/Makefile.am
index 6a00e6d1b6ba90cbaa049f91c0d7abf4235b60a1..50f87ca40a8474f159565371629036df74918c69 100644 (file)
@@ -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             \
similarity index 99%
rename from lib/ns/tests/listenlist_test.c
rename to tests/ns/listenlist_test.c
index 353fac22e7ba258f3798909907b863cd8cd7f48b..565b943f7d3c7092d785c272d98a2e7dbf936aed 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <ns/listenlist.h>
 
-#include <ns/test.h>
+#include <tests/ns.h>
 
 static int
 _setup(void **state) {
similarity index 98%
rename from lib/ns/tests/notify_test.c
rename to tests/ns/notify_test.c
index 57953c6a6c5418762c60fc936cf08977a482eb1a..c5e3009640cc1ba058864a2cf770c64a86931c70 100644 (file)
@@ -37,9 +37,8 @@
 #include <ns/client.h>
 #include <ns/notify.h>
 
-#include <dns/test.h>
-
-#include <ns/test.h>
+#include <tests/dns.h>
+#include <tests/ns.h>
 
 static int
 setup_test(void **state) {
similarity index 99%
rename from lib/ns/tests/plugin_test.c
rename to tests/ns/plugin_test.c
index 5c2f371c2f9e1e1880e15f71e0a20659e739259d..6434fae3a409e6f9a61880f02b77a9c9c562d122 100644 (file)
@@ -35,7 +35,7 @@ _fail(const char *const file, const int line);
 
 #include <ns/hooks.h>
 
-#include <ns/test.h>
+#include <tests/ns.h>
 
 /*%
  * Structure containing parameters for run_full_path_test().
similarity index 99%
rename from lib/ns/tests/query_test.c
rename to tests/ns/query_test.c
index de2fb849f0e9a24bda6ba2b2c56d6f106746d45b..c86d98d9ac07877c19d034ec3ddb097f11ae8bb2 100644 (file)
@@ -38,7 +38,7 @@
 #include <ns/server.h>
 #include <ns/stats.h>
 
-#include <ns/test.h>
+#include <tests/ns.h>
 
 static int
 setup_test(void **state) {