Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- g++ $1 -o $2 -Wall
- if [ $? -ne 0 ] ; then
- exit 1
- fi
- outs="outs"
- tests_dir="$2_tests"
- if [ ! -e $outs ]; then
- mkdir $outs
- fi
- for i in $tests_dir/*.test; do
- b=`basename "$i" ".test"`
- outf=$outs/$b.out
- expoutf=$tests_dir/${b}.testout
- ./$2 < "$i" > "$outf"
- cmp "$outf" "$expoutf" &> /dev/null
- if [ $? -eq 0 ]
- then
- echo "OK -- $b"
- else
- echo "FAIL($1) -- $b"
- cat "$i"
- echo -e "\n----"
- cat "$outf"
- echo
- fi
- echo "====="
- done
Advertisement
Add Comment
Please, Sign In to add comment