1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-17 20:29:32 +00:00

More tests

This commit is contained in:
A. Fachat 2014-08-20 13:02:57 +02:00
parent 282f48e1ea
commit 7453b3076d
9 changed files with 70 additions and 2 deletions

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

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

32
xa/tests/fordef/runtest.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# run a test script
#THISDIR=`dirname $0`
THISDIR=`pwd`
#echo "0=$0"
#echo "THISDIR=$THISDIR"
declare -A opts
#opts=([816.asm]="-w")
#opts[02.asm]="-C"
#ASMFLAGS=-v
ASMFLAGS=
# exclude filter from *.asm if no explicit file is given
EXCLUDE=
# test files used
TESTFILES="test2.s"
# files to compare afterwards, against <file>-<script>
COMPAREFILES="a.out test.asm.err test4.asm.err"
XA=$THISDIR/../../xa
##########################
# actual code
. ../func.sh

View File

@ -16,5 +16,5 @@ t1 lda `forward1
sta `forward2
rts
#include "test2.asm"
#include "test2.s"

View File

@ -0,0 +1,4 @@
Copyright (C) 1989-2009 Andre Fachat, Jolse Maginnis, David Weinehall
and Cameron Kaiser.
test.asm:line 6: 0400: Warning - Can't optimize forward-defined label; using absolute addressing
test.asm:line 7: 0403: Warning - Can't optimize forward-defined label; using absolute addressing

View File

@ -18,4 +18,4 @@
lda (forward1),y
jmp forward3
#include "test2.asm"
#include "test2.s"

18
xa/tests/fordef/test4.asm Normal file
View File

@ -0,0 +1,18 @@
.word $0400
*=$0400
/* define this if you want to crash and burn */
jmp `forward3
bne `forward3
lda (`forward1),y
lda (`forward3),y
sta `forward3
/* this looks like it should fail, but won't because there is no ambiguity */
lda (forward1),y
jmp forward3
#include "test2.s"

View File

@ -0,0 +1,7 @@
Copyright (C) 1989-2009 Andre Fachat, Jolse Maginnis, David Weinehall
and Cameron Kaiser.
test4.asm:line 6: 0400:Wrong addressing mode error
test4.asm:line 7: 0402:Wrong addressing mode error
test4.asm:line 8: 0401:Wrong addressing mode error
test4.asm:line 9: 0400:Wrong addressing mode error
test4.asm:line 9: 0409:Overflow error

View File

@ -202,6 +202,7 @@ for script in $TESTSCRIPTS; do
else
ALOG="-P $LOGFILE"
fi
ALOG="$ALOG -e $script.err"
# overwrite test files in each iteration, just in case
for i in $TESTFILES; do
@ -275,6 +276,7 @@ if test $CLEAN -ge 2; then
for script in $TESTSCRIPTS; do
rm -f $TMPDIR/$script.log
rm -f $TMPDIR/$script.err
done;
# gzipped test files are unzipped