covscan.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/bash
  2. #
  3. # Copyright 2017 James E. King, III
  4. # Distributed under the Boost Software License, Version 1.0.
  5. # (See accompanying file LICENSE_1_0.txt or copy at
  6. # http://www.boost.org/LICENSE_1_0.txt)
  7. #
  8. # Bash script to run in travis to perform a Coverity Scan build
  9. #
  10. #
  11. # Environment Variables
  12. #
  13. # COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify
  14. # COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure)
  15. # SELF - the boost libs directory name
  16. set -ex
  17. pushd /tmp
  18. rm -rf coverity_tool.tgz cov-analysis*
  19. wget -nv https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=boostorg/$SELF" -O coverity_tool.tgz
  20. tar xzf coverity_tool.tgz
  21. COVBIN=$(echo $(pwd)/cov-analysis*/bin)
  22. export PATH=$COVBIN:$PATH
  23. popd
  24. cd libs/$SELF/test
  25. ../../../b2 toolset=gcc clean
  26. rm -rf cov-int/
  27. cov-build --dir cov-int ../../../b2 toolset=gcc -q -j3
  28. tar cJf cov-int.tar.xz cov-int/
  29. curl --form token="$COVERITY_SCAN_TOKEN" \
  30. --form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \
  31. --form file=@cov-int.tar.xz \
  32. --form version="$(git describe --tags)" \
  33. --form description="boostorg/$SELF" \
  34. https://scan.coverity.com/builds?project="boostorg/$SELF"