From: Jo Zzsi Date: Sat, 2 Aug 2025 17:30:43 +0000 (-0400) Subject: test: use "set -u" in in test-container.sh X-Git-Tag: 109~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c9230f;p=thirdparty%2Fdracut-ng.git test: use "set -u" in in test-container.sh To make testing more robust, use `set -u`. --- diff --git a/test/test-container.sh b/test/test-container.sh index 81e41c951..e38c25f50 100755 --- a/test/test-container.sh +++ b/test/test-container.sh @@ -8,7 +8,7 @@ if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /de exit 1 fi -set -e +set -eu if [ "${V-}" = "2" ]; then set -x; fi [[ -d ${0%/*} ]] && cd "${0%/*}"/../ @@ -22,11 +22,11 @@ if [ "${V-}" = "2" ]; then set -x; fi ) # disable building documentation by default -[ -z "$enable_documentation" ] && export enable_documentation=no +[ -z "${enable_documentation-}" ] && export enable_documentation=no # shellcheck disable=SC2086 -./configure --enable-test $CONFIGURE_ARG +./configure --enable-test ${CONFIGURE_ARG-} # treat warnings as error # shellcheck disable=SC2086 -CFLAGS="-Wextra -Werror" make TEST_RUN_ID="${TEST_RUN_ID:=$1}" TESTS="${TESTS:=$2}" V="${V:=1}" $MAKEFLAGS ${TARGETS:=all install check} +CFLAGS="-Wextra -Werror" make TEST_RUN_ID="${TEST_RUN_ID:=$1}" TESTS="${TESTS:=$2}" V="${V:=1}" ${MAKEFLAGS-} ${TARGETS:=all install check}