1
0
mirror of https://github.com/fachat/xa65.git synced 2024-12-29 07:29:50 +00:00

Update and fix test suite scripts and first tests

This commit is contained in:
A. Fachat 2014-08-19 17:25:27 +02:00
parent b4f36e9061
commit dfbafeb0b5
12 changed files with 71 additions and 9 deletions

5
xa/tests/adrm/Makefile Normal file
View File

@ -0,0 +1,5 @@
tests:
./runtest.sh -q -C

BIN
xa/tests/adrm/a.out-02 Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-816 Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-c02 Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-zab Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-zab2 Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-zpa Normal file

Binary file not shown.

BIN
xa/tests/adrm/a.out-zpa2 Normal file

Binary file not shown.

28
xa/tests/adrm/bip2.inc Normal file
View File

@ -0,0 +1,28 @@
/*
- tbasic.0.asm: if you make vecwri absolute with !, then the branch gets
generated as if it were NOT absolute. works okay without it (and
gets a warning)
*/
test lda !$0095
bne test
ldx #13
lup0 lda !vecwri,x
sta $2005,x
dex
bne lup0
lda #$00
sta $0020
lda #$02
sta $0021
lda #$ff
sta $0022
lda #$13
sta $0023
jmp $2003
vectors .byt $4c, $5a, $1e, $4c, $a0, $1e, $4c, $00, $01
vecwri = vectors - 1

View File

@ -8,8 +8,24 @@ THISDIR=`pwd`
echo "0=$0"
echo "THISDIR=$THISDIR"
declare -A opts
#opts=([816.asm]="-w")
opts[02.asm]="-C"
opts[816.asm]="-w"
opts[zab.asm]="-w"
opts[zpa.asm]="-w"
#ASMFLAGS=-v
ASMFLAGS=
# exclude filter from *.asm if no explicit file is given
EXCLUDE=
TESTFILES=
# test files used
TESTFILES="bip.inc bip2.inc"
# files to compare afterwards, against <file>-<script>
COMPAREFILES=a.out
XA=$THISDIR/../../xa
@ -172,7 +188,7 @@ else
done;
fi;
echo "TESTSCRIPTS=$TESTSCRIPTS"
#echo "TESTSCRIPTS=$TESTSCRIPTS"
########################
# tmp names
@ -207,6 +223,14 @@ for script in $TESTSCRIPTS; do
echo "Run script $script"
AFLAGS="${ASMFLAGS} ${opts[$script]}"
ALOG=
if test "x$LOGFILE" = "x"; then
ALOG="-P $script.log"
else
ALOG="-P $LOGFILE"
fi
# overwrite test files in each iteration, just in case
for i in $TESTFILES; do
@ -221,12 +245,8 @@ for script in $TESTSCRIPTS; do
############################################
# simply do assemble
echo "Run assembler:" $XA $VERBOSE $script $TMPDIR
if test "x$LOGFILE" = "x"; then
(cd $TMPDIR; $XA -o a.out -P $script.log $script)
else
(cd $TMPDIR; $XA -o a.out -P $LOGFILE $script)
fi
echo "Run assembler:" $XA $AFLAGS $script
(cd $TMPDIR; $XA -o a.out $ALOG $AFLAGS $script)
RESULT=$?
if test $RESULT -eq 0; then
@ -240,7 +260,7 @@ for script in $TESTSCRIPTS; do
for i in $DEBUG; do
echo "break $i" >> $DEBUGFILE
done;
gdb -x $DEBUGFILE -ex "run -o a.out -P $LOGFILE $script.asm" $XA
gdb -x $DEBUGFILE -ex "run -o $TMPDIR/a.out $ALOG $AFLAGS $script" $XA
fi;
#echo "Killing server (pid $SERVERPID)"
@ -272,6 +292,7 @@ for script in $TESTSCRIPTS; do
if test $CLEAN -ge 1; then
rm -f $DEBUGFILE;
rm -f $TMPDIR/$script;
rm -f $TMPDIR/a.out;
fi
done;

4
xa/tests/adrm/zab2.asm Normal file
View File

@ -0,0 +1,4 @@
.word $4000
* = $4000
#include "bip2.inc"

4
xa/tests/adrm/zpa2.asm Normal file
View File

@ -0,0 +1,4 @@
.word $0000
* = $0000
#include "bip2.inc"