Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- for ((testNum=0;testNum<$4;testNum++))
- do
- ./$3 > input
- ./$2 < input > outSlow
- ./$1 < input > outWrong
- H1=`md5sum outWrong`
- H2=`md5sum outSlow`
- if !(cmp -s "outWrong" "outSlow")
- then
- echo "Error found!"
- echo "Input:"
- cat input
- echo "Wrong Output:"
- cat outWrong
- echo "Slow Output:"
- cat outSlow
- exit
- fi
- done
- echo Passed $4 tests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement