]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: make test.sh more convinent to use by adding wildcard support
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 8 Nov 2024 23:41:31 +0000 (18:41 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 9 Nov 2024 00:51:23 +0000 (19:51 -0500)
test/test-github.sh

index fb03cd0d8e28b35a632685da82ddf5f752515555..23a31cdea73a6c712341a06cad115c190a6648f3 100755 (executable)
@@ -17,6 +17,15 @@ export DRACUT=dracut
 # shellcheck disable=SC2086
 ./configure $CONFIGURE_ARG
 
+TESTS="${TESTS:=$2}"
+
+# Compute wildcards for TESTS variable (e.g. '1*')
+# shellcheck disable=SC1001
+[ -n "$TESTS" ] && TESTS=$(
+    cd test
+    for T in ${TESTS}; do find . -depth -type d -name "TEST-*${T}*" -exec echo {} \; | cut -d\- -f2 | tr '\n' ' '; done
+)
+
 # treat warnings as error
 # shellcheck disable=SC2086
-CFLAGS="-Wextra -Werror" make TEST_RUN_ID="${TEST_RUN_ID:=$1}" TESTS="${TESTS:=$2}" V="${V:=1}" ${TARGETS:=all install check}
+CFLAGS="-Wextra -Werror" make TEST_RUN_ID="${TEST_RUN_ID:=$1}" TESTS="${TESTS}" V="${V:=1}" ${TARGETS:=all install check}