From 4ce6c9f4a5d8ec3ce604619ce756f73cbbb81f89 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Fri, 23 Aug 2024 02:45:53 +0200 Subject: [PATCH] Avoid bogus comparisons when linking fails This avoids drowning RGBLINK's errors in a meaningless `diff` output --- test/asm/test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/asm/test.sh b/test/asm/test.sh index 5bf64923..6d75e958 100755 --- a/test/asm/test.sh +++ b/test/asm/test.sh @@ -114,11 +114,14 @@ for i in *.asm; do desired_binname=${i%.asm}.out.bin if [ -f "$desired_binname" ]; then - "$RGBLINK" -o "$gb" "$o" - rom_size=$(printf %s $(wc -c <"$desired_binname")) - dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null - tryCmp "$desired_binname" "$output" gb - (( our_rc = our_rc || $? )) + if ! "$RGBLINK" -o "$gb" "$o"; then + echo "${bold}${red}\`$RGBLINK -o $gb $o\` failed!${rescolors}${resbold}" + else + rom_size=$(printf %s $(wc -c <"$desired_binname")) + dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null + tryCmp "$desired_binname" "$output" gb + (( our_rc = our_rc || $? )) + fi fi (( rc = rc || our_rc ))