diff options
Diffstat (limited to 'src/boost/libs/program_options/ci')
-rwxr-xr-x | src/boost/libs/program_options/ci/build.sh | 19 | ||||
-rwxr-xr-x | src/boost/libs/program_options/ci/codecov.sh | 43 | ||||
-rwxr-xr-x | src/boost/libs/program_options/ci/coverity.sh | 42 | ||||
-rwxr-xr-x | src/boost/libs/program_options/ci/cppcheck.sh | 38 | ||||
-rwxr-xr-x | src/boost/libs/program_options/ci/mingw.bat | 50 |
5 files changed, 192 insertions, 0 deletions
diff --git a/src/boost/libs/program_options/ci/build.sh b/src/boost/libs/program_options/ci/build.sh new file mode 100755 index 00000000..49dd24ae --- /dev/null +++ b/src/boost/libs/program_options/ci/build.sh @@ -0,0 +1,19 @@ +#! /bin/bash +# +# Copyright 2017 James E. King III +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +# Bash script to run in travis to perform a bjam build +# cwd should be $BOOST_ROOT/libs/$SELF before running +# + +set -ex + +# default language level: c++03 +if [[ -z "$CXXSTD" ]]; then + CXXSTD=03 +fi + +$BOOST_ROOT/b2 . toolset=$TOOLSET cxxstd=$CXXSTD $CXXFLAGS $DEFINES $LINKFLAGS $TESTFLAGS $B2_ADDRESS_MODEL $B2_LINK $B2_THREADING $B2_VARIANT -j3 $* diff --git a/src/boost/libs/program_options/ci/codecov.sh b/src/boost/libs/program_options/ci/codecov.sh new file mode 100755 index 00000000..2f7ea10f --- /dev/null +++ b/src/boost/libs/program_options/ci/codecov.sh @@ -0,0 +1,43 @@ +#! /bin/bash +# +# Copyright 2017, 2018 James E. King III +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +# Bash script to run in travis to perform codecov.io integration +# + +### +### NOTE: Make sure you grab .codecov.yml +### + +# assumes cwd is the top level directory of the boost project +# assumes an environment variable $SELF is the boost project name + +set -ex + +B2_VARIANT=debug +ci/build.sh cxxflags=-fprofile-arcs cxxflags=-ftest-coverage linkflags=-fprofile-arcs linkflags=-ftest-coverage + +# switch back to the original source code directory +cd $TRAVIS_BUILD_DIR + +# get the version of lcov +lcov --version + +# coverage files are in ../../b2 from this location +lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --base-directory "$BOOST_ROOT/libs/$SELF" --directory "$BOOST_ROOT" --capture --output-file all.info + +# all.info contains all the coverage info for all projects - limit to ours +lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --extract all.info "*/boost/$SELF/*" "*/libs/$SELF/src/*" --output-file coverage.info + +# dump a summary on the console - helps us identify problems in pathing +lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --list coverage.info + +# +# upload to codecov.io +# +curl -s https://codecov.io/bash > .codecov +chmod +x .codecov +./.codecov -f coverage.info -X gcov -x "gcov-7" diff --git a/src/boost/libs/program_options/ci/coverity.sh b/src/boost/libs/program_options/ci/coverity.sh new file mode 100755 index 00000000..0de08a4c --- /dev/null +++ b/src/boost/libs/program_options/ci/coverity.sh @@ -0,0 +1,42 @@ +#! /bin/bash +# +# Copyright 2017 James E. King III +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +# Bash script to run in travis to perform a Coverity Scan build +# To skip the coverity integration download (which is huge) if +# you already have it from a previous run, add --skipdownload +# + +# +# Environment Variables +# +# COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify +# COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure) +# SELF - the boost libs directory name + +set -ex + +pushd /tmp +if [[ "$1" != "--skipdownload" ]]; then + rm -rf coverity_tool.tgz cov-analysis* + wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=boostorg/$SELF" -O coverity_tool.tgz + tar xzf coverity_tool.tgz +fi +COVBIN=$(echo $(pwd)/cov-analysis*/bin) +export PATH=$COVBIN:$PATH +popd + +ci/build.sh clean +rm -rf cov-int/ +cov-build --dir cov-int ci/build.sh +tar cJf cov-int.tar.xz cov-int/ +curl --form token="$COVERITY_SCAN_TOKEN" \ + --form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \ + --form file=@cov-int.tar.xz \ + --form version="$(git describe --tags)" \ + --form description="boostorg/$SELF" \ + https://scan.coverity.com/builds?project="boostorg/$SELF" + diff --git a/src/boost/libs/program_options/ci/cppcheck.sh b/src/boost/libs/program_options/ci/cppcheck.sh new file mode 100755 index 00000000..7734ffcc --- /dev/null +++ b/src/boost/libs/program_options/ci/cppcheck.sh @@ -0,0 +1,38 @@ +#! /bin/bash +# +# Copyright 2018 James E. King III +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +# Bash script to run in travis to perform a cppcheck +# cwd should be $BOOST_ROOT before running +# + +set -ex + +# default language level: c++03 +if [[ -z "$CXXSTD" ]]; then + CXXSTD=03 +fi + +# Travis' ubuntu-trusty comes with cppcheck 1.62 which is pretty old +# default cppcheck version: 1.82 +if [[ -z "$CPPCHKVER" ]]; then + CPPCHKVER=1.82 +fi + +pushd ~ +wget https://github.com/danmar/cppcheck/archive/$CPPCHKVER.tar.gz +tar xzf $CPPCHKVER.tar.gz +mkdir cppcheck-build +cd cppcheck-build +cmake ../cppcheck-$CPPCHKVER -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/cppcheck +make -j3 install +popd + +~/cppcheck/bin/cppcheck -I. --std=c++$CXXSTD --enable=all --error-exitcode=1 \ + --force --check-config --suppress=*:boost/preprocessor/tuple/size.hpp \ + -UBOOST_USER_CONFIG -UBOOST_COMPILER_CONFIG -UBOOST_STDLIB_CONFIG -UBOOST_PLATFORM_CONFIG \ + libs/$SELF 2>&1 | grep -v 'Cppcheck does not need standard library headers' + diff --git a/src/boost/libs/program_options/ci/mingw.bat b/src/boost/libs/program_options/ci/mingw.bat new file mode 100755 index 00000000..bc189fdb --- /dev/null +++ b/src/boost/libs/program_options/ci/mingw.bat @@ -0,0 +1,50 @@ +:: +:: MinGW Build Script for Appveyor, leveraging the MSYS2 installation +:: Copyright (C) 2018 James E. King III +:: Distributed under the Boost Software License, Version 1.0. +:: (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) +:: + +@ECHO ON +SETLOCAL EnableDelayedExpansion + +:: Set up the toolset +echo using gcc : %FLAVOR% : %ARCH%-w64-mingw32-g++.exe ; > %USERPROFILE%\user-config.jam +SET UPPERFLAVOR=%FLAVOR% +CALL :TOUPPER UPPERFLAVOR + +:: Install packages needed to build boost +:: Optional: comment out ones this library does not need, +:: so people can copy this script to another library. + +FOR %%a IN ("gcc" "icu" "libiconv" "openssl" "xz" "zlib") DO ( + c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^ + "pacman --sync --needed --noconfirm %FLAVOR%/mingw-w64-%ARCH%-%%a" || EXIT /B +) +c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^ + "pacman --sync --needed --noconfirm python3" || EXIT /B + +:: +:: Now build things... +:: + +c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^ + "cd %CD:\=/% && ./bootstrap.sh --with-toolset=gcc" || EXIT /B + +c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^ + "cd %CD:\=/% && ./b2 libs/%SELF% toolset=gcc-%FLAVOR% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3" || EXIT /B + +EXIT /B 0 + +:: +:: Function to uppercase a variable +:: from: https://stackoverflow.com/questions/34713621/batch-converting-variable-to-uppercase +:: + +:TOUPPER <variable> +@ECHO OFF +FOR %%a IN ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I" + "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R" + "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z" ) DO ( CALL SET %~1=%%%~1:%%~a%% ) +@ECHO ON +GOTO :EOF
\ No newline at end of file |