diff --git a/xa/tests/Makefile b/xa/tests/Makefile index 4f86821..3b90213 100644 --- a/xa/tests/Makefile +++ b/xa/tests/Makefile @@ -1,8 +1,7 @@ +TESTS=adrm binclude chardelimiter charset comcom fordef + tests: - (cd adrm; make tests) - (cd binclude; make tests) - (cd chardelimiter; make tests) - (cd charset; make tests) - (cd comcom; make tests) + for i in $(TESTS); do (cd $$i; make tests); done + diff --git a/xa/tests/chardelimiter/runtest.sh b/xa/tests/chardelimiter/runtest.sh index 68e2b9f..3f00192 100755 --- a/xa/tests/chardelimiter/runtest.sh +++ b/xa/tests/chardelimiter/runtest.sh @@ -8,7 +8,7 @@ THISDIR=`pwd` #echo "0=$0" #echo "THISDIR=$THISDIR" -declare -A opts +#declare -A opts #opts=([816.asm]="-w") #opts[02.asm]="-C" diff --git a/xa/tests/fordef/runtest.sh b/xa/tests/fordef/runtest.sh index 80f3aed..4165e1e 100755 --- a/xa/tests/fordef/runtest.sh +++ b/xa/tests/fordef/runtest.sh @@ -11,6 +11,8 @@ THISDIR=`pwd` declare -A opts #opts=([816.asm]="-w") #opts[02.asm]="-C" +declare -A errs +errs[test4.asm]=1 #ASMFLAGS=-v ASMFLAGS= diff --git a/xa/tests/fordef/test4.asm.err-test4 b/xa/tests/fordef/test4.asm.err similarity index 100% rename from xa/tests/fordef/test4.asm.err-test4 rename to xa/tests/fordef/test4.asm.err diff --git a/xa/tests/func.sh b/xa/tests/func.sh index 45650d5..0a66a2d 100755 --- a/xa/tests/func.sh +++ b/xa/tests/func.sh @@ -1,5 +1,8 @@ #!/bin/bash +declare -A errs +declare -A opts + function usage() { echo "Assemble *.asm or *.a65 test files" @@ -172,10 +175,12 @@ DEBUGFILE="$TMPDIR"/gdb.ex # remember stdout for summary output exec 5>&1 +exec 6>&2 # redirect log when quiet if test $QUIET -ge 1 ; then exec 1>$TMPDIR/stdout.log + exec 2>$TMPDIR/stderr.log fi ######################## @@ -221,6 +226,15 @@ for script in $TESTSCRIPTS; do (cd $TMPDIR; $XA -o a.out $ALOG $AFLAGS $script) RESULT=$? + # check if we actually expected an error + #echo "errs=${errs[$script]}" + if [ "x${errs[$script]}" != "x" ]; then + if [ "$RESULT" = ${errs[$script]} ]; then + echo "override error because was expected" + RESULT=0 + fi + fi + if test $RESULT -eq 0; then echo "$script: Ok" >&5 else @@ -238,6 +252,11 @@ for script in $TESTSCRIPTS; do #echo "Killing server (pid $SERVERPID)" #kill -TERM $SERVERPID + if [ -f "${THISDIR}/$script.err" ]; then + echo "Comparing file ${script}.err" + hexdiff ${THISDIR}/$script.err ${TMPDIR}/$script.err + fi + if test "x$COMPAREFILES" != "x"; then testname=`basename $script .asm` if [ "$script" = "$testname" ]; then @@ -285,6 +304,7 @@ if test $CLEAN -ge 2; then done; rm -f $TMPDIR/stdout.log + rm -f $TMPDIR/stderr.log # only remove work dir if we own it (see option -R) if test $OWNDIR -ge 1; then