Newer
Older
dub_jkp / scripts / ci / travis.sh
  1. #!/bin/bash
  2.  
  3. set -v -e -o pipefail
  4.  
  5. vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
  6. dub fetch vibe-d@$vibe_ver # get optional dependency
  7. dub test --compiler=${DC} -c library-nonet
  8.  
  9. export DMD="$(command -v $DMD)"
  10.  
  11. if [ "$FRONTEND" \> 2.087.z ]; then
  12. ./build.d -preview=dip1000 -preview=in -w -g -debug
  13. fi
  14.  
  15. function clean() {
  16. # Hard reset of the DUB local folder is necessary as some tests
  17. # currently don't properly clean themselves
  18. rm -rf ~/.dub
  19. git clean -dxf -- test
  20. }
  21.  
  22. if [ "$COVERAGE" = true ]; then
  23. # library-nonet fails to build with coverage (Issue 13742)
  24. dub test --compiler=${DC} -b unittest-cov
  25. ./build.d -cov
  26.  
  27. wget https://codecov.io/bash -O codecov.sh
  28. bash codecov.sh
  29. else
  30. ./build.d
  31. DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
  32. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  33. fi
  34.  
  35. ## Checks that only need to be done once per CI run
  36. ## Here the `COVERAGE` variable is abused for this purpose,
  37. ## as it's only defined once in the whole Travis matrix
  38. if [ "$COVERAGE" = true ]; then
  39. # run tests with different compilers
  40. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  41. clean
  42.  
  43. export FRONTEND=2.077
  44. source $(~/dlang/install.sh ldc-1.7.0 --activate)
  45. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  46. deactivate
  47. clean
  48.  
  49. export FRONTEND=2.068
  50. source $(~/dlang/install.sh gdc-4.8.5 --activate)
  51. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  52. deactivate
  53.  
  54. # check for trailing whitespace
  55. find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
  56. # check that the man page generation still works
  57. source $(~/dlang/install.sh dmd --activate)
  58. source $(~/dlang/install.sh dub --activate)
  59. dub --single -v scripts/man/gen_man.d
  60. fi