#!/bin/bash

exec 2> err

mainX=main1

echo "### ptest ${1}" 
cp ptest${1} $mainX
rm -rf a.out
gcc -std=c99 -include stdbool.h test.c 
if [ "${?}" -eq 0 ];
then
	rm -f out err
	./a.out > out 2> err
	if [ "${?}" -eq "0" ];
	then
		cat out
	else
		echo "  runtime error"
	fi
else
	echo "  compile error"
fi
