diff options
test: Add shellcheck
1 files changed, 19 insertions, 2 deletions
| -rwxr-xr-x | configure | 21 |
@@ -26,6 +26,7 @@ Variables: CFLAGS=OPTIONS EXTRA_CFLAGS=OPTIONS MANDOC=BIN + SHELLCHECK=BIN WITH_WEBKITGTK=(4.0|4.1) WITH_URI_PARSER=(guri|libsoup2) @@ -37,7 +38,8 @@ Dependencies: - libxml-2.0 - webkit2gtk-4.1 version >=${min_webkitgtk} or webkit2gtk-4.0 version >=${min_webkitgtk} - libsoup-2.4 or glib-2.0 version >=${min_glib_guri} -- mandoc: for linting the manual page (optionnal, test dep) +- mandoc: for linting the manual page (optional, test dep) +- shellcheck: for linting ./configure (optional, test dep) END } @@ -73,6 +75,7 @@ INKSCAPE="${INKSCAPE:-inkscape}" CC="${CC:-cc}" CFLAGS="${CFLAGS:--g -O2 -pie -fPIE}" MANDOC="${MANDOC:-mandoc}" +SHELLCHECK="${SHELLCHECK:-shellcheck}" # Also allow variables through arguments @@ -111,6 +114,7 @@ APPSDIR="${APPSDIR:-${PREFIX}/share/applications}" CFLAGS="${CFLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla ${EXTRA_CFLAGS}" ## System checks +# commands printf 'Checking %s command existance ...' "${PKGCONFIG}" command -v "${PKGCONFIG}" >/dev/null ; required @@ -122,10 +126,22 @@ if command -v "${MANDOC}" >/dev/null ; is_ok then : else + printf 'Warning: Tests depending on mandoc disabled' MANDOC="true" fi +printf 'Checking %s command existance ...' "${SHELLCHECK}" +if command -v "${SHELLCHECK}" >/dev/null ; is_ok +then + : +else + printf 'Warning: Tests depending on shellcheck disabled' + SHELLCHECK="true" +fi + +echo +# pkg-config for dep in ${DEPS} do pkg_config_check --exists "$dep" || exit 1 @@ -209,7 +225,7 @@ required ## Configuration write -printf 'Writing to config.mk ...' +printf '\nWriting to config.mk ...' cat >config.mk <<EOF # Autogenerated by ./configure PACKAGE = Badwolf @@ -229,6 +245,7 @@ INKSCAPE = ${INKSCAPE} MSGFMT = ${MSGFMT} DBG = ${DBG} MANDOC = ${MANDOC} +SHELLCHECK = ${SHELLCHECK} CFLAGS = ${CFLAGS} -DDATADIR=\"\${DATADIR}\" -DPACKAGE=\"\${PACKAGE}\" -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"\${VERSION_FULL}\" ${DEPS_cflags} LIBS = ${DEPS_libs} |