coverage.sh 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. set -e
  3. if [ "$TRAVIS_CI" == "private" ]; then
  4. exit 0
  5. fi
  6. if [ "$#" != "5" ]; then
  7. echo "Usage is: ${0} \"coverage\" \"<prepend CFLAGS>\" \"<makefile>\" \"<append CFLAGS>\" <math library to link to>"
  8. echo "CC=gcc ${0} \"coverage\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a"
  9. exit -1
  10. fi
  11. if [ -z "$(echo $CC | grep "gcc")" ]; then
  12. echo "no gcc detected, early exit success"
  13. exit 0
  14. fi
  15. # output version
  16. bash printinfo.sh
  17. bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov"
  18. if [ -a testok.txt ] && [ -f testok.txt ]; then
  19. echo
  20. else
  21. echo
  22. echo "Test failed"
  23. exit 1
  24. fi
  25. ./sizes
  26. ./constants
  27. # if this was executed as './coverage.sh ...' create coverage locally
  28. if [[ "${0%% *}" == "./${0##*/}" ]]; then
  29. make lcov-single
  30. else
  31. cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/'
  32. fi
  33. exit 0
  34. # $Source$
  35. # $Revision$
  36. # $Date$