Skip to content

Instantly share code, notes, and snippets.

@lctseng
Last active August 29, 2015 14:10
Show Gist options
  • Save lctseng/8e833f0d7f3c6c9ea959 to your computer and use it in GitHub Desktop.
Save lctseng/8e833f0d7f3c6c9ea959 to your computer and use it in GitHub Desktop.
可以用來快速套用testcase來檢查正確性,不會用此程式,請找原作者謝謝~
#!/bin/sh
chmod +x parser
echo "====CORRECT check start===="
error_cnt=0
for file in ./testcases/correct/*
do
echo "check $file"
./parser $file > .check.tmp 2>&1
if [ $? -ne 0 ]; then
echo "***ERROR:Unable to resolve CORRECT syntax in $file***"
error_cnt=$(($error_cnt + 1))
fi
done
echo "====CORRECT check finished, $error_cnt error(s) found===="
echo "====WRONG check start===="
error_cnt=0
for file in ./testcases/wrong/*
do
echo "check $file"
./parser $file > .check.tmp 2>&1
if [ $? -eq 0 ]; then
echo "***ERROR:Unable to resolve ERROR syntax in $file***"
error_cnt=$(($error_cnt + 1))
fi
done
echo "====WRONG check finished, $error_cnt error(s) found===="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment