Skip to content

Commit

Permalink
Enable ubsan and improve build coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jeking3 committed Feb 27, 2019
1 parent d95d316 commit 5cdb92e
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 119 deletions.
206 changes: 121 additions & 85 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@

#
# Generic Travis CI build script for boostorg repositories
# See: https://github.com/boostorg/boost-ci
#
# Instructions for customizing this script for your library:
#
# 1. Copy the ci/ directory from the same source into your project:
# ci/build.sh runs the build
# ci/codecov.sh is used to run a profiling build and upload results to codecov.io
# ci/coverity.sh is used to run a coverity build and upload results coverity scan
# 2. Customize the compilers and language levels you want. Default is C++03.
# 3. Update the global B2 environment settings to your liking.
# 4. If you have more than include/, src/, and test/ directories then
# add them to the depinst.py line as "--include tools" for tools/ (you
# can put multiple --include on the command line).
# 5. If you want to enable Coverity Scan, you need to provide the environment
# 1. Customize the compilers and language levels you want in the 'jobs'.
# 2. If you have more than include/, src/, test/, example/, examples/, or
# tools/ directories, modify your Travis CI project and add the environment
# variable DEPINST. For example if your build uses code in "bench/" and
# "fog/" directories, then set DEPINST to the following:
# --include bench --include fog
# 3. If you want to enable Coverity Scan, you need to provide the environment
# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
# your github settings.
# 6. Enable pull request builds in your boostorg/<library> account.
# 7. Change the default C++ version in ci/*.sh (search for CXXSTD)
# 4. Enable pull request builds in your boostorg/<library> account.
#
# That's it - the scripts will do everything else for you.

sudo: false
dist: trusty
dist: xenial
language: cpp

env:
Expand All @@ -39,19 +35,9 @@ env:
- B2_VARIANT=variant=release,debug

install:
- export SELF=`basename $TRAVIS_BUILD_DIR`
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update -q --init tools/boostdep
- git submodule update -q --init tools/build
- git submodule update -q --init tools/inspect
- cp -r $TRAVIS_BUILD_DIR/* libs/$SELF
- export BOOST_ROOT="`pwd`"
- export PATH="`pwd`":$PATH
- python tools/boostdep/depinst/depinst.py $SELF --include example
- ./bootstrap.sh
- ./b2 headers
- git clone https://github.com/boostorg/boost-ci.git boost-ci
- cp -pr boost-ci/ci boost-ci/.codecov.yml .
- source ci/travis/install.sh

addons:
apt:
Expand All @@ -66,81 +52,131 @@ branches:
- master

script:
- cd libs/$SELF
- ci/build.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/build.sh

#
# Default toolsets in Ubuntu
#
# trusty xenial bionic
# 14.04 16.04 18.04
# ------ ------ ------
# clang 3.4 3.8 6.0
# gcc 4.8.2 5.3.1 7.3.0
#

anchors:
clang-34: &clang-34 { apt: { packages: [ "clang-3.4" ], sources: [ "llvm-toolchain-xenial-3.4" ] } }
clang-38: &clang-38 { apt: { packages: [ "clang-3.8",
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-3.8",
"ubuntu-toolchain-r-test" ] } }
clang-4: &clang-4 { apt: { packages: [ "clang-4.0",
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-4.0",
"ubuntu-toolchain-r-test" ] } }
clang-5: &clang-5 { apt: { packages: [ "clang-5.0",
"libstdc++-7-dev" ], sources: [ "llvm-toolchain-xenial-5.0",
"ubuntu-toolchain-r-test" ] } }
clang-6: &clang-6 { apt: { packages: [ "clang-6.0",
"libc6-dbg",
"libc++-dev",
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-6.0",
"ubuntu-toolchain-r-test" ] } }
gcc-44: &gcc-44 { apt: { packages: [ "g++-4.4" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-46: &gcc-46 { apt: { packages: [ "g++-4.6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-6: &gcc-6 { apt: { packages: [ "g++-6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-7: &gcc-7 { apt: { packages: [ "g++-7" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-8: &gcc-8 { apt: { packages: [ "g++-8" ], sources: [ "ubuntu-toolchain-r-test" ] } }

jobs:
allow_failures:
- env:
- COPY="all the environment settings from your job"

include:
# libstdc++
- { os: "linux", env: [ "TOOLSET=gcc-4.4", "CXXSTD=98,0x" ], addons: *gcc-44 }
- { os: "linux", env: [ "TOOLSET=gcc-4.6", "CXXSTD=03,0x" ], addons: *gcc-46 }
- { os: "linux", env: [ "TOOLSET=gcc-4.8", "CXXSTD=03,11" ], addons: *gcc-48 }
- { os: "linux", env: [ "TOOLSET=gcc-5", "CXXSTD=03,11" ], addons: *gcc-5 }
- { os: "linux", env: [ "TOOLSET=gcc-6", "CXXSTD=03,11,14" ], addons: *gcc-6 }
- { os: "linux", env: [ "TOOLSET=gcc-7", "CXXSTD=03,11,14,17" ], addons: *gcc-7 }
- { os: "linux", env: [ "TOOLSET=gcc-8", "CXXSTD=03,11,14,17,2a" ], addons: *gcc-8 }
- { os: "linux", env: [ "TOOLSET=clang-3.4", "CXXSTD=03,11" ], addons: *clang-34 }
- { os: "linux", env: [ "TOOLSET=clang-3.8", "CXXSTD=03,11,14" ], addons: *clang-38 }
- { os: "linux", env: [ "TOOLSET=clang-4.0", "CXXSTD=03,11,14" ], addons: *clang-4 }
- { os: "linux", env: [ "TOOLSET=clang-5.0", "CXXSTD=03,11,14,17" ], addons: *clang-5 }
- { os: "linux", env: [ "TOOLSET=clang-6.0", "CXXSTD=03,11,14,17,2a" ], addons: *clang-6 }

# to enable Intel ICC define INTEL_ICC_SERIAL_NUMBER and disable the following:
# - { os: "linux", env: [ "TOOLSET=intel-linux", "CXXSTD=11,14,17" ], addons: *gcc-7,
# script: cd $BOOST_ROOT/libs/$SELF && ci/travis/intelicc.sh }

# libc++
- { os: "linux", env: [ "TOOLSET=clang-6.0", "CXXSTD=03,11,14,17,2a",
"CXXFLAGS=-stdlib=libc++" ], addons: *clang-6 }
# the rvm environment on osx is taking over basic commands like "cd" and breaking things!
# - { os: "osx" , env: [ "COMMENT=libc++",
# "TOOLSET=clang", "CXXSTD=03,11,14" ] }

- os: linux
env:
- COMMENT="C++03"
- TOOLSET=gcc,gcc-7
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- COMMENT=codecov.io
- TOOLSET=gcc-7
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
addons: *gcc-7
script:
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && export PATH=/tmp/lcov/bin:$PATH && which lcov && lcov --version && popd
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/codecov.sh

- os: linux
env:
- COMMENT="C++11"
- TOOLSET=clang
- CXXSTD=11
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
env:
- COMMENT=cppcheck
script:
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/cppcheck.sh

- os: linux
env:
- COMMENT=valgrind
- TOOLSET=clang
env:
- COMMENT=ubsan
- B2_VARIANT=variant=debug
- TESTFLAGS=testing.launcher=valgrind
addons:
apt:
packages:
- clang-5.0
- libstdc++-7-dev
- valgrind
sources:
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- TOOLSET=gcc-8
- CXXSTD=03,11,14,17,2a
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
- CXXFLAGS="cxxflags=-fno-omit-frame-pointer cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined"
- LINKFLAGS="linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined linkflags=-fuse-ld=gold"
- UBSAN_OPTIONS=print_stacktrace=1
addons: *gcc-8

- os: linux
env:
- COMMENT=cppcheck
- COMMENT=valgrind
- TOOLSET=clang-6.0
- CXXSTD=03,11,14,17,2a
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
- B2_VARIANT=variant=debug
- TESTFLAGS=testing.launcher=valgrind
- VALGRIND_OPTS=--error-exitcode=1
addons: *clang-6
script:
- libs/$SELF/ci/cppcheck.sh
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/valgrind.sh

#################### Jobs to run on pushes to master, develop ###################

# Coverity Scan
- os: linux
env:
- COMMENT=CodeCov
if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push))
env:
- COMMENT="Coverity Scan"
- TOOLSET=gcc-7
addons:
apt:
packages:
- gcc-7
- g++-7
sources:
- ubuntu-toolchain-r-test
addons: *gcc-7
script:
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && cd lcov && sudo make install && which lcov && lcov --version && popd
- cd libs/$SELF
- ci/codecov.sh

#################### Jobs to run on every pull request ####################
# osx was disabled because it is very slow to start (can delay builds by 30 minutes)
# - os: osx
# osx_image: xcode9
# env:
# - TOOLSET=clang
# - CXXSTD=03,11

#################### Jobs to run on pushes to master, develop ###################
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/coverity.sh

notifications:
email:
false

Loading

0 comments on commit 5cdb92e

Please sign in to comment.