#!/bin/sh

# generate and run all tests generated by $1

if ../util/testgen $1
then 

FILES="[0-9]*-${1}.mms"

# echo $FILES
for i in $FILES
do
	echo -n "."
        if ../util/mmixal -b 1000 -l ${i%.mms}.mml $i
        then 
	    if !  ../util/mmix ${i%.mms}.mmo 
	  then
	    echo $PWD
            echo Error running File $i
            exit 1
          fi
	else
	    echo $PWD
            echo Error assembling File $i
	    exit 1
	fi
done

else
    echo $PWD
    echo Unable to generate testcases: $1
    exit 1
fi
echo
