Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 61 lines (48 sloc) 1.29 KB
#!/bin/bash
# Author: Bowen (bm2734), Yunxuan (ys3065)
files="syntax_tests/test-*.xpp syntax_tests/fail-*.xpp"
TOPLEVEL="./toplevel.native"
Check() {
basename=`echo $1 | sed 's/.*\\///
s/.xpp//'`
reffile=`echo $1 | sed 's/.xpp$//'`
basedir="`echo $1 | sed 's/\/[^\/]*$//'`/."
echo "Testing ${basename}..."
$TOPLEVEL -a $1 > ${basename}.out
if diff -bB ${basename}.out ${reffile}.out > ${basename}.diff
then
echo "positive test succeeded"
else
echo "positive test failed"
fi
rm -f ${basename}.out ${basename}.diff
}
CheckFail() {
basename=`echo $1 | sed 's/.*\\///
s/.xpp//'`
reffile=`echo $1 | sed 's/.xpp$//'`
basedir="`echo $1 | sed 's/\/[^\/]*$//'`/."
echo "Testing ${basename}..."
$TOPLEVEL -a $1 2> ${basename}.err
if diff -bB ${basename}.err ${reffile}.err > ${basename}.diff
then
echo "negative test succeeded"
else
echo "negative test failed"
fi
rm -f ${basename}.err ${basename}.diff
}
for file in $files
do
case $file in
*test-*)
Check $file
;;
*fail-*)
CheckFail $file
;;
*)
echo "unknown file type $file"
;;
esac
done
You can’t perform that action at this time.