Add more tests for unionized sections + fix bugs

Implementing those tests found a few bugs... oops
This commit is contained in:
ISSOtm
2020-03-22 01:46:10 +01:00
parent 275b8e15ff
commit 4877bb783c
28 changed files with 178 additions and 7 deletions

View File

@@ -80,12 +80,25 @@ $RGBLINK -o $gbtemp2 $otemp
i="high-low.asm" tryCmp $gbtemp $gbtemp2
rc=$(($? || $rc))
$RGBASM -o $otemp section-union/a.asm
$RGBASM -o $gbtemp2 section-union/b.asm
$RGBLINK -o $gbtemp -l section-union/script.link $otemp $gbtemp2
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < section-union/ref.out.bin)) > $otemp 2>/dev/null
i="section-union.asm" tryCmp section-union/ref.out.bin $otemp
$RGBASM -o $otemp section-union/good/a.asm
$RGBASM -o $gbtemp2 section-union/good/b.asm
$RGBLINK -o $gbtemp -l section-union/good/script.link $otemp $gbtemp2
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < section-union/good/ref.out.bin)) > $otemp 2>/dev/null
i="section-union.asm" tryCmp section-union/good/ref.out.bin $otemp
rc=$(($? || $rc))
for i in section-union/*.asm; do
$RGBASM -o $otemp $i
$RGBASM -o $gbtemp2 $i -DSECOND
if $RGBLINK $otemp $gbtemp2 > $outtemp 2>&1; then
echo -e "${bold}${red}$i didn't fail to link!${rescolors}${resbold}"
rc=1
fi
echo --- >> $outtemp
# Ensure RGBASM also errors out
echo 'SECOND equs "1"' | cat $i - $i | $RGBASM - 2>> $outtemp
tryDiff ${i%.asm}.out $outtemp
rc=$(($? || $rc))
done
rm -f $otemp $gbtemp $gbtemp2 $outtemp
exit $rc