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/.
(cherry picked from commit
2c3b2dabe9a6b3c4a10f6498a1169f39ed031eed)
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)/'
Priority: 55
- Regex: '^".*"'
Priority: 99
+ - Regex: '^<tests/'
+ Priority: 100
- Regex: '<openssl/'
Priority: 1
- Regex: '<(mysql|protobuf-c)/'
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/'
Priority: 7
- Regex: '^(<[^/]*)/)'
Priority: 8
+ - Regex: '^<tests/'
+ Priority: 10
- Regex: '<[[:alnum:].]+>'
Priority: 1
- Regex: '".*"'
SUBDIRS = . lib doc bin fuzz
+if HAVE_CMOCKA
+SUBDIRS += tests
+endif HAVE_CMOCKA
+
BUILT_SOURCES = bind.keys.h
CLEANFILES = bind.keys.h
.PHONY: doc
-EXTRA_DIST = \
+EXTRA_DIST = \
util/bindkeys.pl \
contrib \
CHANGES \
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)
# 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
libdns_la_CPPFLAGS += $(LMDB_CFLAGS)
libdns_la_LIBADD += $(LMDB_LIBS)
endif
-
-if HAVE_CMOCKA
-SUBDIRS = tests
-endif
--- /dev/null
+../../tests/dns
\ No newline at end of file
libirs_la_LDFLAGS = \
$(AM_LDFLAGS) \
-release "$(PACKAGE_VERSION)"
-
-if HAVE_CMOCKA
-SUBDIRS = tests
-endif
--- /dev/null
+../../tests/irs
\ No newline at end of file
libisc_la_LIBADD += \
$(LIBXML2_LIBS)
endif HAVE_LIBXML2
-
-if HAVE_CMOCKA
-SUBDIRS = tests
-endif
--- /dev/null
+../../tests/isc
\ No newline at end of file
libisccfg_la_LDFLAGS = \
$(AM_LDFLAGS) \
-release "$(PACKAGE_VERSION)"
-
-if HAVE_CMOCKA
-SUBDIRS = tests
-endif
--- /dev/null
+../../tests/isccfg
\ No newline at end of file
libns_la_LDFLAGS = \
$(AM_LDFLAGS) \
-release "$(PACKAGE_VERSION)"
-
-if HAVE_CMOCKA
-SUBDIRS = tests
-endif
--- /dev/null
+../../tests/ns
\ No newline at end of file
--- /dev/null
+/unit-test-driver.sh
--- /dev/null
+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
#include <dns/view.h>
#include <dns/zone.h>
-#include <dns/test.h>
+#include <tests/dns.h>
dns_zonemgr_t *zonemgr = NULL;
$(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 \
geoip_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
- $(MAXMINDDB_CFLAGS)
+ $(MAXMINDDB_CFLAGS) \
+ -DTEST_GEOIP_DATA=\"$(top_srcdir)/bin/tests/system/geoip2/data\"
geoip_test_LDADD = \
$(LDADD) \
#include <dns/acl.h>
-#include <dns/test.h>
+#include <tests/dns.h>
#define BUFLEN 255
#define BIGBUFLEN (70 * 1024)
#include <dns/name.h>
#include <dns/rdatalist.h>
-#include <dns/test.h>
+#include <tests/dns.h>
#define BUFLEN 255
#define BIGBUFLEN (64 * 1024)
#include <dns/journal.h>
#include <dns/name.h>
-#include <dns/test.h>
+#include <tests/dns.h>
#define BUFLEN 255
#define BIGBUFLEN (64 * 1024)
#include <dns/dbiterator.h>
#include <dns/name.h>
-#include <dns/test.h>
+#include <tests/dns.h>
#define BUFLEN 255
#define BIGBUFLEN (64 * 1024)
#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;
#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) {
#include <dns/name.h>
#include <dns/view.h>
-#include <dns/test.h>
+#include <tests/dns.h>
uv_sem_t sem;
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
-#include <dns/test.h>
+#include <tests/dns.h>
static void
multiple_prefixes(void) {
#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__))) {
#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) {
#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;
#include <dst/dst.h>
-#include <dns/test.h>
+#include <tests/dns.h>
dns_keytable_t *keytable = NULL;
dns_ntatable_t *ntatable = NULL;
#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, ...) {
#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;
#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) {
#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
#include <dns/peer.h>
-#include <dns/test.h>
+#include <tests/dns.h>
/* Test DSCP set/get functions */
ISC_RUN_TEST_IMPL(dscp) {
#include <dst/dst.h>
-#include <dns/test.h>
+#include <tests/dns.h>
static dns_rdatatype_t privatetype = 65534;
#include <dst/dst.h>
-#include <dns/test.h>
+#include <tests/dns.h>
typedef struct {
dns_rbt_t *rbt;
#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",
#include <dns/rdata.h>
-#include <dns/test.h>
+#include <tests/dns.h>
static bool debug = false;
#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) {
#include <dns/stats.h>
-#include <dns/test.h>
+#include <tests/dns.h>
static void
set_typestats(dns_stats_t *stats, dns_rdatatype_t type) {
#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;
#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) {
#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
#include <dns/time.h>
-#include <dns/test.h>
+#include <tests/dns.h>
#define TEST_ORIGIN "test"
#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"
#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);
#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) {
#include <dns/zone.h>
#include <dns/zt.h>
-#include <dns/test.h>
+#include <tests/dns.h>
static int
_setup(void **state) {
--- /dev/null
+../../../.clang-format.headers
\ No newline at end of file
#include <dns/diff.h>
#include <dns/zone.h>
-#include <isc/test.h>
+#include <tests/isc.h>
extern dns_zonemgr_t *zonemgr;
#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 { \
#include <ns/hooks.h>
#include <ns/interfacemgr.h>
-#include <dns/test.h>
+#include <tests/dns.h>
typedef struct ns_test_id {
const char *description;
#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;
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 \
#include <isc/string.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
/*
* Test data from NIST KAT
#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) {
#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) {
#include <isc/result.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
#define TEST_INPUT(x) (x), sizeof(x) - 1
#include "uv_wrap.h"
#define KEEP_BEFORE
-#include "../netmgr/http.c"
-#include "../netmgr/netmgr-int.h"
-#include "../netmgr/uv-compat.c"
-#include "../netmgr/uv-compat.h"
-#include "../netmgr_p.h"
+#include "netmgr/http.c"
+#include "netmgr/netmgr-int.h"
+#include "netmgr/uv-compat.c"
+#include "netmgr/uv-compat.h"
+#include "netmgr_p.h"
-#include <isc/test.h>
+#include <tests/isc.h>
#define MAX_NM 2
#include <isc/result.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
typedef struct {
int err;
#include <isc/result.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
#define NAME "internal"
#define SHA "3bed2cb3a3acf7b6a8ef408420cc682d5520e26976d354254f528c965612054f"
#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) {
#include <isc/mem.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
struct e {
unsigned int value;
#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
#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
#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
#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
#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
#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) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
-#include "../netmgr/netmgr-int.h"
-#include "../netmgr/udp.c"
-#include "../netmgr/uv-compat.c"
-#include "../netmgr/uv-compat.h"
-#include "../netmgr_p.h"
+#include "netmgr/netmgr-int.h"
+#include "netmgr/udp.c"
+#include "netmgr/uv-compat.c"
+#include "netmgr/uv-compat.h"
+#include "netmgr_p.h"
#pragma GCC diagnostic pop
-#include <isc/test.h>
+#include <tests/isc.h>
typedef void (*stream_connect_function)(isc_nm_t *nm);
#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) {
#include <isc/pool.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
static isc_result_t
poolinit(void **target, void *arg) {
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <uv.h>
#define UNIT_TESTING
#include <cmocka.h>
#include <isc/thread.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include "netmgr/uv-compat.h"
+
+#include <tests/isc.h>
ISC_RUN_TEST_IMPL(isc_quota_get_set) {
UNUSED(state);
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);
}
#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) {
#include <isc/result.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
#define REPS 25000
#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) {
#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) {
#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) {
#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 },
#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) {
#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) {
#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) {
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <uv.h>
#define UNIT_TESTING
#include <isc/timer.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include "netmgr/uv-compat.h"
+
+#include <tests/isc.h>
/* Set to true (or use -v option) for verbose output */
static bool verbose = false;
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);
}
while (atomic_load(&counter) > 0) {
- uv_sleep(1000);
+ uv_sleep(1);
}
}
#include <isc/taskpool.h>
#include <isc/util.h>
-#include <isc/test.h>
+#include <tests/isc.h>
#define TASK_MAGIC ISC_MAGIC('T', 'A', 'S', 'K')
#define VALID_TASK(t) ISC_MAGIC_VALID(t, TASK_MAGIC)
#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)
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <uv.h>
#define UNIT_TESTING
#include <cmocka.h>
#include <isc/timer.h>
#include <isc/util.h>
-#include "../timer.c"
+#include "netmgr/uv-compat.h"
+#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;
* 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);
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
#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 },
#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 },
#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;
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 \
#include <ns/listenlist.h>
-#include <ns/test.h>
+#include <tests/ns.h>
static int
_setup(void **state) {
#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) {
#include <ns/hooks.h>
-#include <ns/test.h>
+#include <tests/ns.h>
/*%
* Structure containing parameters for run_full_path_test().
#include <ns/server.h>
#include <ns/stats.h>
-#include <ns/test.h>
+#include <tests/ns.h>
static int
setup_test(void **state) {