mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
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:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -115,12 +115,11 @@ for i in *.asm notexist.asm; do
|
|||||||
|
|
||||||
desired_binname=${i%.asm}.out.bin
|
desired_binname=${i%.asm}.out.bin
|
||||||
if [[ -f "$desired_binname" && $our_rc -eq 0 ]]; then
|
if [[ -f "$desired_binname" && $our_rc -eq 0 ]]; then
|
||||||
if ! "$RGBLINK" -o "$gb" "$o"; then
|
# 'rgblink -x' implies '-t', so asm/*.out.bin tests cannot use ROMX past 1
|
||||||
echo "${bold}${red}\`$RGBLINK -o $gb $o\` failed!${rescolors}${resbold}"
|
if ! "$RGBLINK" -x -o "$gb" "$o"; then
|
||||||
|
echo "${bold}${red}\`$RGBLINK -x -o $gb $o\` failed!${rescolors}${resbold}"
|
||||||
else
|
else
|
||||||
rom_size=$(printf %s $(wc -c <"$desired_binname"))
|
tryCmp "$desired_binname" "$gb" gb
|
||||||
dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null
|
|
||||||
tryCmp "$desired_binname" "$output" gb
|
|
||||||
(( our_rc = our_rc || $? ))
|
(( our_rc = our_rc || $? ))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ tryCmp () {
|
|||||||
tryCmpRom () {
|
tryCmpRom () {
|
||||||
# `printf` lets us keep only the first returned word from `wc`.
|
# `printf` lets us keep only the first returned word from `wc`.
|
||||||
rom_size=$(printf %s $(wc -c <"$1"))
|
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
|
dd if="$gbtemp" count=1 bs="$rom_size" >"$otemp" 2>/dev/null
|
||||||
tryCmp "$1" "$otemp"
|
tryCmp "$1" "$otemp"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user