tests: make test_shellcheck depend on shellcheck
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 17 Feb 2023 19:04:31 +0000 (14:04 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 20 Feb 2023 17:23:50 +0000 (12:23 -0500)
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 <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/meta/Makefile.am

index 6605bf95ad6d8c8e261c23980e4df39b6875628c..31e9f03c1ed252321c58d68fe08f1f2fbd17af75 100644 (file)
@@ -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])
index becce81378ac7c0fe74d43c9dc7a189a1c200ca1..0514ecc276a60fed2038b44ea7eb5b11e3c71b8e 100644 (file)
@@ -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)
 
This page took 0.026575 seconds and 4 git commands to generate.