1
0
mirror of https://github.com/fachat/xa65.git synced 2026-04-19 19:16:25 +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
View File
@@ -0,0 +1,5 @@
tests:
./runtest.sh -q -C
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+28
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
+30 -9
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
View File
@@ -0,0 +1,4 @@
.word $4000
* = $4000
#include "bip2.inc"
+4
View File
@@ -0,0 +1,4 @@
.word $0000
* = $0000
#include "bip2.inc"