From 3286572aa7db7be059b2aac67e738fad4e73144f Mon Sep 17 00:00:00 2001 From: marketideas Date: Sun, 17 Nov 2019 19:05:50 -0800 Subject: [PATCH] test --- asm.h | 3 ++- runtests.sh | 29 +++++++++++++++++++++++++++-- todo.txt | 21 +++++++++++++++++++-- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/asm.h b/asm.h index b48d85e..27f9de8 100644 --- a/asm.h +++ b/asm.h @@ -347,13 +347,14 @@ public: std::string savepath; TSymbol *currentsym; + TSymbol topSymbol; + std::string currentsymstr; std::vector lines; Poco::HashMapopcodes; Poco::HashMap macros; Poco::HashMap symbols; Poco::HashMap variables; - TSymbol topSymbol; TOriginSection PC; TLUPstruct curLUP; diff --git a/runtests.sh b/runtests.sh index 13f90b4..0c22973 100755 --- a/runtests.sh +++ b/runtests.sh @@ -25,6 +25,8 @@ for S in $SRC ; do S1=${S1/.S/.bin} S1=${S1/.s/.bin} + BASE=${S/.S/} + BASE=${BASE/.s/} ./qasm -o 0/$OUTDIR/$S1 ./testdata/$S >> $TMPFILE R=?$ @@ -32,10 +34,33 @@ for S in $SRC ; do R=`cat $TMPFILE | grep "End qASM assembly"` E=`echo $R | awk -e '{ print $6; }'` ect=`echo $(($E))` + + MSHA="Q" + QSHA="M" + + if [ -f ./testdata/M32_expected/$BASE ] ; then + MSHA=`sha256sum ./testdata/M32_expected/$BASE | awk '{ print $1;}'` 2>/dev/null >/dev/null + fi + + if [ -f $OUTDIR/$BASE.bin ] ; then + QSHA=`sha256sum $OUTDIR/$BASE.bin |awk '{print $1;}'` 2>/dev/null >/dev/null + fi + #echo "$MSHA $QSHA" + + shapass=0; + CX=" " + + if [ "$MSHA""L" != "$QSHA""L" ] ; then + shapass=1 + CX="!" + fi + P="PASS: " TOTAL=$(($TOTAL+1)) - if [ $ect != 0 ] ; then - printf 'FAIL: (%3s) ' $ect + pct=$(($ect+$shapass)) + if [ $pct != 0 ] ; then + printf 'FAIL: (%3s) ' $ect + printf '%s ' $CX FAILCT=$(($FAILCT+1)) else diff --git a/todo.txt b/todo.txt index 1dc1728..5989439 100644 --- a/todo.txt +++ b/todo.txt @@ -1,2 +1,19 @@ -2019-11-17 - BRK does not detect a lable that can't be evaluated -2019-11-17 - ASCII parsing in both eval and for ASC type commands + (0) 2019-11-17 - BRK does not detect a lable that can't be evaluated + (0) 2019-11-17 - ASCII parsing in both eval and for ASC type commands + (0) 2019-11-17 -s IF processing for character compare mode + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s + (0) 2019-11-17 -s +