From f0dfc6a8dec485139b1b797a435791a4455184a3 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 11 May 2026 09:05:47 +0200 Subject: [PATCH] test: skip defconfig backup files at find time, not mid-loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit defconfig.sh used $# (find result, incl. *~ / *.bak) for the TAP total but then 'continue'd past backups without decrementing — so a stray bpi_r4_*_defconfig~ in the tree made TAP see "1..23" followed by only 21 results, and the harness treated the missing 2 as failures. Filter the patterns at find instead; $# now matches what the loop iterates over Signed-off-by: Joachim Wiberg --- test/case/repo/defconfig.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/case/repo/defconfig.sh b/test/case/repo/defconfig.sh index b3acbea1..2699f9cd 100755 --- a/test/case/repo/defconfig.sh +++ b/test/case/repo/defconfig.sh @@ -31,12 +31,6 @@ check() echo "1..$total" for defconfig in "$@"; do - # Skip UNIX backup files - case "$defconfig" in - *~|*.bak|'#'*'#'|.#*) - continue - ;; - esac base=$(basename "$defconfig") if whitelist "$base"; then echo "ok $num - $base is exempted # skip" @@ -50,6 +44,9 @@ check() } # shellcheck disable=SC2046 -check $(find "$CONFIGS" -maxdepth 1 -type f | LC_ALL=C sort) || exit 1 +check $(find "$CONFIGS" -maxdepth 1 -type f \ + ! -name '*~' ! -name '*.bak' \ + ! -name '#*#' ! -name '.#*' \ + | LC_ALL=C sort) || exit 1 exit 0