]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: use "set -u" in in test-container.sh
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 2 Aug 2025 17:30:43 +0000 (13:30 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Tue, 5 Aug 2025 16:56:19 +0000 (12:56 -0400)
To make testing more robust, use `set -u`.

test/test-container.sh

index 81e41c951c99b7ceb711000bd73d50c16ad847d6..e38c25f505ecbfb6e9244eaf9cfc6c20f6dad61d 100755 (executable)
@@ -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}