]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Stop the unit tests from running twice
authorEvan Hunt <each@isc.org>
Wed, 4 May 2022 02:43:23 +0000 (19:43 -0700)
committerOndřej Surý <ondrej@isc.org>
Tue, 31 May 2022 10:06:00 +0000 (12:06 +0200)
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.

(cherry picked from commit 568f65cc56370c211454d041c6b13d0d593cadab)

Makefile.tests
configure.ac
tests/Makefile.am
tests/libtest/Makefile.am [new file with mode: 0644]
tests/libtest/dns.c [moved from tests/dns.c with 100% similarity]
tests/libtest/isc.c [moved from tests/isc.c with 100% similarity]
tests/libtest/ns.c [moved from tests/ns.c with 100% similarity]

index d7b2e948e0f66b2362796837ea6153deaa94161e..e1b7e0e046e8ff9b9041e926fb62a5fe5d7d8ef7 100644 (file)
@@ -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)
index 99a87c661e68296ab05456c24619749a10479443..e9f4bb7fe31b88167d0d7ce9753568f00b9a8629 100644 (file)
@@ -1581,7 +1581,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])
index 0a19bb1d1fa83a81c25f969b251b24c65f37e070..8b5dcbe842154ee1e23d5779dbb6ec4b3ba8ac39 100644 (file)
@@ -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 =
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
new file mode 100644 (file)
index 0000000..2699f4b
--- /dev/null
@@ -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
similarity index 100%
rename from tests/dns.c
rename to tests/libtest/dns.c
similarity index 100%
rename from tests/isc.c
rename to tests/libtest/isc.c
similarity index 100%
rename from tests/ns.c
rename to tests/libtest/ns.c