From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH v2 7/7] Makefile: Enable support for 'make check'
Date: Tue, 2 Sep 2025 16:45:43 +0200 [thread overview]
Message-ID: <aLcDF_OEWQ5KmkZr@calendula> (raw)
In-Reply-To: <20250829155203.29000-8-phil@nwl.cc>
On Fri, Aug 29, 2025 at 05:52:03PM +0200, Phil Sutter wrote:
> Add the various testsuite runners to TESTS variable and have make call
> them with RUN_FULL_TESTSUITE=1 env var.
Given you add a env var for every test, would you instead use
distcheck-hook: in Makefile.am to short circuit the test run and
display SKIPPED?
> 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' by keeping TESTS variable empty when in a distcheck environment.
>
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
> 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'
> ---
> Makefile.am | 10 ++++++++++
> configure.ac | 5 +++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/Makefile.am b/Makefile.am
> index 5190a49ae69f1..f65e8d51b501e 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,12 @@ 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 >$@
> +
> +AM_TESTS_ENVIRONMENT = RUN_FULL_TESTSUITE=1; export RUN_FULL_TESTSUITE;
> +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-02 14:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 15:51 [nft PATCH v2 0/7] Run all test suites via 'make check' Phil Sutter
2025-08-29 15:51 ` [nft PATCH v2 1/7] tests: Prepare exit codes for automake Phil Sutter
2025-08-29 15:51 ` [nft PATCH v2 2/7] tests: monitor: Support running all tests in one go Phil Sutter
2025-09-02 14:43 ` Pablo Neira Ayuso
2025-09-03 11:04 ` Phil Sutter
2025-08-29 15:51 ` [nft PATCH v2 3/7] tests: py: Set default options based on RUN_FULL_TESTSUITE Phil Sutter
2025-09-02 15:33 ` Pablo Neira Ayuso
2025-09-03 11:13 ` Phil Sutter
2025-08-29 15:52 ` [nft PATCH v2 4/7] tests: json_echo: Skip if run as non-root Phil Sutter
2025-08-29 15:52 ` [nft PATCH v2 5/7] tests: shell: Skip packetpath/nat_ftp in fake root env Phil Sutter
2025-08-29 15:52 ` [nft PATCH v2 6/7] tests: build: Do not assume caller's CWD Phil Sutter
2025-08-29 15:52 ` [nft PATCH v2 7/7] Makefile: Enable support for 'make check' Phil Sutter
2025-09-02 14:45 ` Pablo Neira Ayuso [this message]
2025-09-03 11:06 ` Phil Sutter
2025-09-03 11:11 ` Pablo Neira Ayuso
2025-09-03 11:17 ` 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=aLcDF_OEWQ5KmkZr@calendula \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.