From: Michael Jeanson Date: Fri, 17 Feb 2023 19:04:31 +0000 (-0500) Subject: tests: make test_shellcheck depend on shellcheck X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7e090e6bea2c8ea8ef7b776caf17b529b1e1f7ce;p=lttng-tools.git tests: make test_shellcheck depend on shellcheck 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 --- 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)