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

allow error override (for negative tests) and check "-e" log file

This commit is contained in:
A. Fachat 2014-08-20 21:39:20 +02:00
parent 7453b3076d
commit 33bbe0b7ef
5 changed files with 27 additions and 6 deletions

View File

@ -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

View File

@ -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"

View File

@ -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=

View File

@ -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