Give explicit test output if the scramble-romx size is wrong

This commit is contained in:
Rangi42
2024-02-26 18:26:17 -05:00
parent b66212e6d6
commit 3da201b26e

View File

@@ -51,6 +51,14 @@ tryCmpRom () {
tryCmp "$1" "$otemp" tryCmp "$1" "$otemp"
} }
tryCmpRomSize () {
rom_size=$(printf %s $(wc -c <"$1"))
if [ "$rom_size" -ne "$2" ]; then
echo "$bold${red}${i%.asm} binary size mismatch! ${rescolors}${resbold}"
false
fi
}
rgblinkQuiet () { rgblinkQuiet () {
out="$(env $RGBLINK "$@")" || return $? out="$(env $RGBLINK "$@")" || return $?
if [[ -n "$out" ]]; then if [[ -n "$out" ]]; then
@@ -168,8 +176,7 @@ rgblinkQuiet -o "$gbtemp" -S romx=3 "$otemp" >"$outtemp" 2>&1
tryDiff scramble-romx/out.err "$outtemp" tryDiff scramble-romx/out.err "$outtemp"
(( rc = rc || $? )) (( rc = rc || $? ))
# This test does not compare its exact output with 'tryCmpRom' because no scrambling order is guaranteed # This test does not compare its exact output with 'tryCmpRom' because no scrambling order is guaranteed
rom_size=$(printf %s $(wc -c <"$gbtemp")) tryCmpRomSize "$gbtemp" 65536
test "$rom_size" = 65536 # Check for exactly 3 ROMX banks
(( rc = rc || $? )) (( rc = rc || $? ))
i="section-fragment/jr-offset.asm" i="section-fragment/jr-offset.asm"