Skip to content

Commit

Permalink
Stop the unit tests from running twice
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
each committed May 28, 2022
1 parent 2c3b2da commit 568f65c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Makefile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ AM_CPPFLAGS += \
-DNAMED_PLUGINDIR=\"$(pkglibdir)\" \
-DTESTS_DIR=\"$(abs_srcdir)\"

LDADD += \
$(top_builddir)/tests/libtest.la \
LDADD += \
$(top_builddir)/tests/libtest/libtest.la \
$(CMOCKA_LIBS)
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,8 @@ AC_CONFIG_FILES([tests/Makefile
tests/dns/Makefile
tests/ns/Makefile
tests/irs/Makefile
tests/isccfg/Makefile])
tests/isccfg/Makefile
tests/libtest/Makefile])

AC_CONFIG_FILES([tests/unit-test-driver.sh],
[chmod +x tests/unit-test-driver.sh])
Expand Down
18 changes: 2 additions & 16 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,5 @@ LDADD += \
$(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
SUBDIRS = libtest isc dns ns isccfg irs
check_PROGRAMS =
28 changes: 28 additions & 0 deletions tests/libtest/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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)

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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 568f65c

Please sign in to comment.