mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Systemize RGBLINK testing
This commit is contained in:
@@ -10,70 +10,62 @@ rc=0
|
|||||||
RGBASM=../../rgbasm
|
RGBASM=../../rgbasm
|
||||||
RGBLINK=../../rgblink
|
RGBLINK=../../rgblink
|
||||||
|
|
||||||
$RGBASM -o $otemp bank-numbers.asm
|
for i in *.asm; do
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
$RGBASM -o $otemp $i
|
||||||
diff --strip-trailing-cr bank-numbers.out $outtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
dd if=$gbtemp count=1 bs=20 > $otemp 2>/dev/null
|
|
||||||
diff --strip-trailing-cr bank-numbers.out.bin $otemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
|
|
||||||
$RGBASM -o $otemp fixed-oob.asm
|
# Some tests have variants depending on flags
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
ran_flag=
|
||||||
diff --strip-trailing-cr fixed-oob.out $outtemp
|
for flag in '-d' '-t' '-w'; do
|
||||||
rc=$(($? || $rc))
|
if [ -f ${i%.asm}-no${flag}.out ]; then
|
||||||
|
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
||||||
|
diff --strip-trailing-cr ${i%.asm}-no${flag}.out $outtemp
|
||||||
|
rc=$(($? || $rc))
|
||||||
|
ran_flag=1
|
||||||
|
fi
|
||||||
|
if [ -f ${i%.asm}${flag}.out ]; then
|
||||||
|
$RGBLINK ${flag} -o $gbtemp $otemp > $outtemp 2>&1
|
||||||
|
diff --strip-trailing-cr ${i%.asm}${flag}.out $outtemp
|
||||||
|
rc=$(($? || $rc))
|
||||||
|
ran_flag=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -n "$ran_flag" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
$RGBASM -o $otemp section-attributes.asm
|
# Other tests have several linker scripts
|
||||||
$RGBLINK -l section-attributes.link -o $gbtemp $otemp > $outtemp 2>&1
|
for script in `find . -name "${i%.asm}*.link"`; do
|
||||||
diff --strip-trailing-cr section-attributes.out $outtemp
|
$RGBLINK -l $script -o $gbtemp $otemp > $outtemp 2>&1
|
||||||
rc=$(($? || $rc))
|
diff --strip-trailing-cr ${script%.link}.out $outtemp
|
||||||
$RGBLINK -l section-attributes-mismatch.link -o $gbtemp $otemp > $outtemp 2>&1
|
rc=$(($? || $rc))
|
||||||
diff --strip-trailing-cr section-attributes-mismatch.out $outtemp
|
ran_flag=1
|
||||||
rc=$(($? || $rc))
|
done
|
||||||
|
if [ -n "$ran_flag" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
$RGBASM -o $otemp wramx-dmg-mode.asm
|
# The rest of the tests just links a file, and maybe checks the binary
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
||||||
diff --strip-trailing-cr wramx-dmg-mode-no-d.out $outtemp
|
if [ -f ${i%.asm}.out ]; then
|
||||||
rc=$(($? || $rc))
|
diff --strip-trailing-cr ${i%.asm}.out $outtemp
|
||||||
$RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
|
rc=$(($? || $rc))
|
||||||
diff --strip-trailing-cr wramx-dmg-mode-d.out $outtemp
|
fi
|
||||||
rc=$(($? || $rc))
|
|
||||||
|
|
||||||
$RGBASM -o $otemp vram-fixed-dmg-mode.asm
|
bin=${i%.asm}.out.bin
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
if [ -f $bin ]; then
|
||||||
diff --strip-trailing-cr vram-fixed-dmg-mode-no-d.out $outtemp
|
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < $bin)) > $otemp 2>/dev/null
|
||||||
rc=$(($? || $rc))
|
diff --strip-trailing-cr $bin $otemp
|
||||||
$RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
|
rc=$(($? || $rc))
|
||||||
diff --strip-trailing-cr vram-fixed-dmg-mode-d.out $outtemp
|
fi
|
||||||
rc=$(($? || $rc))
|
done
|
||||||
|
|
||||||
$RGBASM -o $otemp vram-floating-dmg-mode.asm
|
# This test does its own thing
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
$RGBASM -o $otemp high-low/a.asm
|
||||||
diff --strip-trailing-cr vram-floating-dmg-mode-no-d.out $outtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
$RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
|
|
||||||
diff --strip-trailing-cr vram-floating-dmg-mode-d.out $outtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
|
|
||||||
$RGBASM -o $otemp romx-tiny.asm
|
|
||||||
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
|
|
||||||
diff --strip-trailing-cr romx-tiny-no-t.out $outtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
$RGBLINK -t -o $gbtemp $otemp > $outtemp 2>&1
|
|
||||||
diff --strip-trailing-cr romx-tiny-t.out $outtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
|
|
||||||
$RGBASM -o $otemp high-low-a.asm
|
|
||||||
$RGBLINK -o $gbtemp $otemp
|
$RGBLINK -o $gbtemp $otemp
|
||||||
$RGBASM -o $otemp high-low-b.asm
|
$RGBASM -o $otemp high-low/b.asm
|
||||||
$RGBLINK -o $gbtemp2 $otemp
|
$RGBLINK -o $gbtemp2 $otemp
|
||||||
diff --strip-trailing-cr $gbtemp $gbtemp2
|
diff --strip-trailing-cr $gbtemp $gbtemp2
|
||||||
rc=$(($? || $rc))
|
rc=$(($? || $rc))
|
||||||
|
|
||||||
$RGBASM -o $otemp all-instructions.asm
|
|
||||||
$RGBLINK -o $gbtemp $otemp
|
|
||||||
diff --strip-trailing-cr all-instructions.out.bin $gbtemp
|
|
||||||
rc=$(($? || $rc))
|
|
||||||
|
|
||||||
rm -f $otemp $gbtemp $gbtemp2 $outtemp
|
rm -f $otemp $gbtemp $gbtemp2 $outtemp
|
||||||
exit $rc
|
exit $rc
|
||||||
|
|||||||
Reference in New Issue
Block a user