Fix too-short .out.bin expected test results

RGBASM tests now use `rgblink -x` instead of `dd` to get trimmed
test output. RGBLINK tests cannot do so because some of them
(e.g. bank-numbers.asm and sizeof-startof.asm) rely on ROMX
sections above 1, and `-x` implies `-t` which breaks that.
This commit is contained in:
Rangi42
2025-09-15 09:12:26 -04:00
parent 9f16881d64
commit 1fdeb34e50
6 changed files with 5 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -115,12 +115,11 @@ for i in *.asm notexist.asm; do
desired_binname=${i%.asm}.out.bin
if [[ -f "$desired_binname" && $our_rc -eq 0 ]]; then
if ! "$RGBLINK" -o "$gb" "$o"; then
echo "${bold}${red}\`$RGBLINK -o $gb $o\` failed!${rescolors}${resbold}"
# 'rgblink -x' implies '-t', so asm/*.out.bin tests cannot use ROMX past 1
if ! "$RGBLINK" -x -o "$gb" "$o"; then
echo "${bold}${red}\`$RGBLINK -x -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
tryCmp "$desired_binname" "$gb" gb
(( our_rc = our_rc || $? ))
fi
fi

View File

@@ -58,6 +58,7 @@ tryCmp () {
tryCmpRom () {
# `printf` lets us keep only the first returned word from `wc`.
rom_size=$(printf %s $(wc -c <"$1"))
# 'rgblink -x' implies '-t', so we cannot use '-x' to trim the ROM output
dd if="$gbtemp" count=1 bs="$rom_size" >"$otemp" 2>/dev/null
tryCmp "$1" "$otemp"
}