From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH v4 8/8] Makefile: Enable support for 'make check'
Date: Thu, 4 Sep 2025 17:24:54 +0200 [thread overview]
Message-ID: <20250904152454.13054-9-phil@nwl.cc> (raw)
In-Reply-To: <20250904152454.13054-1-phil@nwl.cc>
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>
---
Changes since v3:
- gitignore 'make check' generated logs and reports
Changes since v2:
- Drop RUN_FULL_TESTSUITE env var, it is not needed anymore
Changes since v1:
- Add an internal configure option set by the distcheck target when
building the project
- Have this configure option define BUILD_DISTCHECK automake variable
- Leave TESTS empty if BUILD_DISTCHECK is set to avoid test suite runs
with 'make distcheck'
---
.gitignore | 13 +++++++++++++
Makefile.am | 9 +++++++++
configure.ac | 5 +++++
3 files changed, 27 insertions(+)
diff --git a/.gitignore b/.gitignore
index 1e3bc5146b2f1..db329eafa5298 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/Makefile.am b/Makefile.am
index 5190a49ae69f1..9112faa2d5c04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ libnftables_LIBVERSION = 2:0:1
###############################################################################
ACLOCAL_AMFLAGS = -I m4
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-distcheck
EXTRA_DIST =
BUILT_SOURCES =
@@ -429,3 +430,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
diff --git a/configure.ac b/configure.ac
index da16a6e257c91..8073d4d8193e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,11 @@ AC_CONFIG_COMMANDS([nftversion.h], [
AC_SUBST([MAKE_STAMP], ["\$(shell date +%s)"])
CFLAGS="${CFLAGS} -DMAKE_STAMP=\${MAKE_STAMP}"
+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 \
--
2.51.0
next prev parent reply other threads:[~2025-09-04 15:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 15:24 [nft PATCH v4 0/8] Run all test suites via 'make check' Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 1/8] tests: monitor: Excercise all syntaxes and variants by default Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 2/8] tests: py: Enable JSON and JSON schema " Phil Sutter
2025-09-04 15:29 ` Pablo Neira Ayuso
2025-09-04 16:13 ` Phil Sutter
2025-09-04 16:56 ` Pablo Neira Ayuso
2025-09-04 18:33 ` Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 3/8] tests: Prepare exit codes for automake Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 4/8] tests: json_echo: Skip if run as non-root Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 5/8] tests: shell: Skip packetpath/nat_ftp in fake root env Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 6/8] tests: build: Do not assume caller's CWD Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 7/8] tests: build: Avoid a recursive 'make check' run Phil Sutter
2025-09-04 15:24 ` Phil Sutter [this message]
2025-09-11 16:14 ` [nft PATCH v4 0/8] Run all test suites via 'make check' Phil Sutter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250904152454.13054-9-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).