You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1016 B

  1. #!/bin/bash
  2. black='\E[30m'
  3. red='\E[31m'
  4. green='\E[32m'
  5. yellow='\E[33m'
  6. blue='\E[34m'
  7. magenta='\E[35m'
  8. cyan='\E[36m'
  9. white='\E[37m'
  10. if [ -f $2 ]; then
  11. data=$2
  12. if [ -f $1.summ ]; then rm $1.summ; fi
  13. if [ -f $1.snap ]; then rm $1.snap; fi
  14. else
  15. data=$1
  16. fi
  17. if ! ./$1 < $data > /dev/null 2> .runtest.log ; then
  18. echo -e $red Test $1 failed: $black
  19. echo -e $blue
  20. cat .runtest.log
  21. echo -e $black
  22. exit 1
  23. else
  24. if [ -f $1.summ ]; then
  25. if [ `grep "FATAL ERROR" $1.summ | wc -l` -gt 0 ]; then
  26. echo -e $red "Test $1 failed (FATAL ERROR, read the file $1.summ for details)" $black
  27. echo -e $blue
  28. cat .runtest.log
  29. echo -e $black
  30. exit 1;
  31. fi
  32. if [ `grep "FAILED THE TESTS OF ERROR-EXITS" $1.summ | wc -l` -gt 0 ]; then
  33. echo -e $red "Test $1 failed (FAILED THE TESTS OF ERROR-EXITS, read the file $1.summ for details)" $black
  34. echo -e $blue
  35. cat .runtest.log
  36. echo -e $black
  37. exit 1;
  38. fi
  39. fi
  40. echo -e $green Test $1 passed$black
  41. fi