Newer
Older
dub_jkp / travis-ci.sh
  1. #!/bin/bash
  2.  
  3. set -v -e -o pipefail
  4.  
  5. source ~/dlang/*/activate # activate host compiler
  6.  
  7. if [ -z "$FRONTEND" -o "$FRONTEND" \> 2.068.z ]; then
  8. vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
  9. dub fetch vibe-d --version=$vibe_ver # get optional dependency
  10. dub test --compiler=${DC} -c library-nonet
  11. fi
  12.  
  13. if [ "$COVERAGE" = true ]; then
  14. # library-nonet fails to build with coverage (Issue 13742)
  15. dub test --compiler=${DC} -b unittest-cov
  16. ./build.sh -cov
  17.  
  18. # run tests with different compilers
  19. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  20. deactivate
  21. git clean -dxf -- test
  22. source $(~/dlang/install.sh ldc --activate)
  23. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  24. deactivate
  25. git clean -dxf -- test
  26. source $(~/dlang/install.sh gdc --activate)
  27. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  28. else
  29. ./build.sh
  30. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  31. fi
  32.  
  33. if [ "$COVERAGE" = true ]; then
  34. wget https://codecov.io/bash -O codecov.sh
  35. bash codecov.sh
  36. fi
  37.  
  38. # check for trailing whitespace (needs to be done only once per build)
  39. if [ "$COVERAGE" = true ]; then
  40. find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
  41. fi