Skip to content

Instantly share code, notes, and snippets.

@jokeofweek
Last active December 12, 2015 04:08
Show Gist options
  • Save jokeofweek/4711922 to your computer and use it in GitHub Desktop.
Save jokeofweek/4711922 to your computer and use it in GitHub Desktop.
Automated tester for COMP 251 A2.
for i in {1..100}
do
vars=`expr $RANDOM % 20`
vars=`expr $vars + 2`
tests=`expr $RANDOM % $vars`
tests=`expr $tests + $RANDOM % $vars`
tests=`expr $tests + $RANDOM % $vars`
tests=`expr $tests + $RANDOM % $vars`
tests=`expr $tests + $RANDOM % $vars`
tests=`expr $tests + $RANDOM % $vars`
echo "Testing $vars $tests"
java GenerateTests $vars $tests > a.txt
a=`java Assig2 a.txt`
b=`java Assig2 -nobrute a.txt`
if [ $a != $b ]
then
echo "Error:"
echo "Implication graph result: $a"
echo "Brute force result: $b"
echo "See failing test case in a.txt"
exit 1
fi
done
@strategineer
Copy link

I think you these two up (lines 14-15 and 19-20). :) Thanks a lot though, I found something bug in my code thanks to this. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment