Skip to content

Commit 568f65c

Browse files
committed
Stop the unit tests from running twice
Move the libtest code into a 'libtest' subdirectory and make it one of the SUBDIRS in the tests Makefile. having it at the top level required having "." as one of the subdirs, and that caused the unit tests to be executed twice.
1 parent 2c3b2da commit 568f65c

File tree

7 files changed

+34
-19
lines changed

7 files changed

+34
-19
lines changed

Makefile.tests

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ AM_CPPFLAGS += \
1818
-DNAMED_PLUGINDIR=\"$(pkglibdir)\" \
1919
-DTESTS_DIR=\"$(abs_srcdir)\"
2020

21-
LDADD += \
22-
$(top_builddir)/tests/libtest.la \
21+
LDADD += \
22+
$(top_builddir)/tests/libtest/libtest.la \
2323
$(CMOCKA_LIBS)

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ AC_CONFIG_FILES([tests/Makefile
15861586
tests/dns/Makefile
15871587
tests/ns/Makefile
15881588
tests/irs/Makefile
1589-
tests/isccfg/Makefile])
1589+
tests/isccfg/Makefile
1590+
tests/libtest/Makefile])
15901591

15911592
AC_CONFIG_FILES([tests/unit-test-driver.sh],
15921593
[chmod +x tests/unit-test-driver.sh])

tests/Makefile.am

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,5 @@ LDADD += \
1212
$(LIBDNS_LIBS) \
1313
$(LIBNS_LIBS)
1414

15-
SUBDIRS = . isc dns ns isccfg irs
16-
17-
check_LTLIBRARIES = libtest.la
18-
19-
noinst_libtest_ladir = .
20-
noinst_libtest_la_HEADERS = \
21-
include/tests/dns.h \
22-
include/tests/isc.h \
23-
include/tests/ns.h
24-
libtest_la_SOURCES = \
25-
$(noinst_libtest_la_HEADERS) \
26-
dns.c \
27-
isc.c \
28-
ns.c
29-
30-
include $(top_srcdir)/Makefile.tests
15+
SUBDIRS = libtest isc dns ns isccfg irs
16+
check_PROGRAMS =

tests/libtest/Makefile.am

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
include $(top_srcdir)/Makefile.top
2+
3+
AM_CPPFLAGS += \
4+
$(LIBISC_CFLAGS) \
5+
$(LIBDNS_CFLAGS) \
6+
$(LIBNS_CFLAGS) \
7+
$(LIBUV_CFLAGS) \
8+
-I$(top_srcdir)/lib/isc
9+
10+
LDADD += \
11+
$(LIBISC_LIBS) \
12+
$(LIBDNS_LIBS) \
13+
$(LIBNS_LIBS)
14+
15+
check_LTLIBRARIES = libtest.la
16+
17+
noinst_libtest_ladir = ..
18+
noinst_libtest_la_HEADERS = \
19+
../include/tests/dns.h \
20+
../include/tests/isc.h \
21+
../include/tests/ns.h
22+
libtest_la_SOURCES = \
23+
$(noinst_libtest_la_HEADERS) \
24+
dns.c \
25+
isc.c \
26+
ns.c
27+
28+
include $(top_srcdir)/Makefile.tests
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)