Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- if [[ $# -eq 0 ]] ; then
- fld=.
- else
- fld=${1%/}
- if ! [ -d $fld ]; then echo "Folder not found!"; exit 1; fi
- fi
- if ! [ -f $fld/main.cpp ]; then echo "File $fld/main.cpp not found!"; exit 1; fi
- g++ -Wall -std=c++11 -DNDEBUG -O3 $fld/main.cpp -lgmp -lmpfr -lCGAL -lCGAL_Core -o $fld/main
- echo -e "\e[32mCompilation completed successfully!\e[39m"
- tstfld=$fld
- #tstfld=$fld/testsets
- #while ! [ -d $tstfld ]; do
- # read -e -p "Folder $tstfld not found, please specify new test folder: " -i "$fld/" tstfld
- #done
- #tstfld=${tstfld%/}
- for testcase in $(find $tstfld -name "*.*in" | sort)
- do
- echo "Testing test case $testcase"
- cat $testcase | $fld/main | diff -y --suppress-common-lines -Z ${testcase%in}out -
- echo -e "\e[32mTest case $testcase tested successfully!\e[39m"
- done
- echo -e "\e[102m\e[30mAll test cases were passed!\e[39m\e[49m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement