From 7e090e6bea2c8ea8ef7b776caf17b529b1e1f7ce Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 17 Feb 2023 14:04:31 -0500 Subject: [PATCH] tests: make test_shellcheck depend on shellcheck MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since this test is only useful for development, don't fail the build on platforms that lack shellcheck. Another approach could be to add a dedicated make target to run the meta tests but this was easier as a quick fix. Change-Id: If9d30c7c4e3ee526f028ad82545e631ace272354 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- configure.ac | 3 +++ tests/meta/Makefile.am | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6605bf95a..31e9f03c1 100644 --- a/configure.ac +++ b/configure.ac @@ -171,6 +171,9 @@ AM_CONDITIONAL([HAVE_OBJCOPY], [test "x$OBJCOPY" != "x"]) AC_PATH_PROG([PGREP], [pgrep]) AM_CONDITIONAL([HAVE_PGREP], [test "x$PGREP" != "x"]) +AC_PATH_PROG([SHELLCHECK], [shellcheck]) +AM_CONDITIONAL([HAVE_SHELLCHECK], [test "x$SHELLCHECK" != "x"]) + # set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file # is not distributed in tarballs AS_IF([test -f "$srcdir/bootstrap"], [in_git_repo=yes], [in_git_repo=no]) diff --git a/tests/meta/Makefile.am b/tests/meta/Makefile.am index becce8137..0514ecc27 100644 --- a/tests/meta/Makefile.am +++ b/tests/meta/Makefile.am @@ -4,7 +4,11 @@ LOG_DRIVER_FLAGS = --merge LOG_DRIVER = env PGREP='$(PGREP)' AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tests/utils/tap-driver.sh -TESTS = test_shellcheck +TESTS = + +if HAVE_SHELLCHECK +TESTS += test_shellcheck +endif EXTRA_DIST = $(TESTS) -- 2.34.1