]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
Makefile: Enable support for 'make check'
authorPhil Sutter <phil@nwl.cc>
Fri, 8 Sep 2023 16:16:29 +0000 (18:16 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 11 Sep 2025 16:11:53 +0000 (18:11 +0200)
With all test suites running all variants by default, add the various
testsuite runners to TESTS variable so 'make check' will execute them.

Introduce --enable-distcheck configure flag for internal use during
builds triggered by 'make distcheck'. This flag will force TESTS
variable to remain empty, so 'make check' run as part of distcheck will
not call any test suite: Most of the test suites require privileged
execution, 'make distcheck' usually doesn't and probably shouldn't.
Assuming the latter is used during the release process, it may even not
run on a machine which is up to date enough to generate meaningful test
suite results. Hence spare the release process from the likely pointless
delay imposed by 'make check'.

Signed-off-by: Phil Sutter <phil@nwl.cc>
.gitignore
Makefile.am
configure.ac

index 1e3bc5146b2f1de689038c9ca706cf86266ba8b6..db329eafa529804908905d6907dd34dbb29c6ccc 100644 (file)
@@ -23,6 +23,19 @@ nftversion.h
 *.payload.got
 tests/build/tests.log
 
+# make check results
+/test-suite.log
+/tests/build/run-tests.sh.log
+/tests/build/run-tests.sh.trs
+/tests/json_echo/run-test.py.log
+/tests/json_echo/run-test.py.trs
+/tests/monitor/run-tests.sh.log
+/tests/monitor/run-tests.sh.trs
+/tests/py/nft-test.py.log
+/tests/py/nft-test.py.trs
+/tests/shell/run-tests.sh.log
+/tests/shell/run-tests.sh.trs
+
 # Debian package build temporary files
 build-stamp
 
index 3e3f1e61092bb52cdf0136f113dd8c2c39de668a..fac7ad55cbe719e2c9f619dbb6303f36ba0c5887 100644 (file)
@@ -23,6 +23,7 @@ libnftables_LIBVERSION = 2:0:1
 ###############################################################################
 
 ACLOCAL_AMFLAGS = -I m4
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck
 
 EXTRA_DIST =
 BUILT_SOURCES =
@@ -431,3 +432,11 @@ doc_DATA = files/nftables/main.nft
 tools/nftables.service: tools/nftables.service.in ${top_builddir}/config.status
        ${AM_V_GEN}${MKDIR_P} tools
        ${AM_V_at}sed -e 's|@''sbindir''@|${sbindir}|g;s|@''pkgsysconfdir''@|${pkgsysconfdir}|g' <${srcdir}/tools/nftables.service.in >$@
+
+if !BUILD_DISTCHECK
+TESTS = tests/build/run-tests.sh \
+       tests/json_echo/run-test.py \
+       tests/monitor/run-tests.sh \
+       tests/py/nft-test.py \
+       tests/shell/run-tests.sh
+endif
index 3517ea041f7ea9dfe7793f0fde4652e3a2ddeb67..a3ae2956cdf3ab585fa102809ea8ff523f3b8f1f 100644 (file)
@@ -154,6 +154,11 @@ AC_CONFIG_COMMANDS([nftversion.h], [
 # so have 'make' call date and pass the value to every 'gcc' call
 AC_SUBST([MAKE_STAMP], ["\$(shell date +%s)"])
 
+AC_ARG_ENABLE([distcheck],
+             AS_HELP_STRING([--enable-distcheck], [Build for distcheck]),
+             [enable_distcheck=yes], [])
+AM_CONDITIONAL([BUILD_DISTCHECK], [test "x$enable_distcheck" = "xyes"])
+
 AC_CONFIG_FILES([                                      \
                Makefile                                \
                libnftables.pc                          \