Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -e
  4.  
  5. if [[ $# -eq 0 ]] ; then
  6. fld=.
  7. else
  8. fld=${1%/}
  9. if ! [ -d $fld ]; then echo "Folder not found!"; exit 1; fi
  10. fi
  11.  
  12. if ! [ -f $fld/main.cpp ]; then echo "File $fld/main.cpp not found!"; exit 1; fi
  13.  
  14. g++ -Wall -std=c++11 -DNDEBUG -O3 $fld/main.cpp -lgmp -lmpfr -lCGAL -lCGAL_Core -o $fld/main
  15. echo -e "\e[32mCompilation completed successfully!\e[39m"
  16.  
  17. tstfld=$fld
  18. #tstfld=$fld/testsets
  19. #while ! [ -d $tstfld ]; do
  20. # read -e -p "Folder $tstfld not found, please specify new test folder: " -i "$fld/" tstfld
  21. #done
  22.  
  23. #tstfld=${tstfld%/}
  24.  
  25. for testcase in $(find $tstfld -name "*.*in" | sort)
  26. do
  27. echo "Testing test case $testcase"
  28. cat $testcase | $fld/main | diff -y --suppress-common-lines -Z ${testcase%in}out -
  29. echo -e "\e[32mTest case $testcase tested successfully!\e[39m"
  30. done
  31. echo -e "\e[102m\e[30mAll test cases were passed!\e[39m\e[49m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement