Skip to content

Commit 9a96f6b

Browse files
committed
Enable ubsan and improve build coverage
1 parent d95d316 commit 9a96f6b

File tree

1 file changed

+95
-83
lines changed

1 file changed

+95
-83
lines changed

.travis.yml

+95-83
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,16 @@
88
#
99
# Instructions for customizing this script for your library:
1010
#
11-
# 1. Copy the ci/ directory from the same source into your project:
12-
# ci/build.sh runs the build
13-
# ci/codecov.sh is used to run a profiling build and upload results to codecov.io
14-
# ci/coverity.sh is used to run a coverity build and upload results coverity scan
15-
# 2. Customize the compilers and language levels you want. Default is C++03.
16-
# 3. Update the global B2 environment settings to your liking.
17-
# 4. If you have more than include/, src/, and test/ directories then
18-
# add them to the depinst.py line as "--include tools" for tools/ (you
19-
# can put multiple --include on the command line).
20-
# 5. If you want to enable Coverity Scan, you need to provide the environment
11+
# 1. Customize the compilers and language levels you want in the 'jobs'.
12+
# 2. If you have more than include/, src/, test/, example/, examples/, or
13+
# tools/ directories, modify your Travis CI project and add the environment
14+
# variable DEPINST. For example if your build uses code in "bench/" and
15+
# "fog/" directories, then set DEPINST to the following:
16+
# --include bench --include fog
17+
# 3. If you want to enable Coverity Scan, you need to provide the environment
2118
# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
2219
# your github settings.
23-
# 6. Enable pull request builds in your boostorg/<library> account.
24-
# 7. Change the default C++ version in ci/*.sh (search for CXXSTD)
20+
# 4. Enable pull request builds in your boostorg/<library> account.
2521
#
2622
# That's it - the scripts will do everything else for you.
2723

@@ -39,19 +35,9 @@ env:
3935
- B2_VARIANT=variant=release,debug
4036

4137
install:
42-
- export SELF=`basename $TRAVIS_BUILD_DIR`
43-
- cd ..
44-
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
45-
- cd boost-root
46-
- git submodule update -q --init tools/boostdep
47-
- git submodule update -q --init tools/build
48-
- git submodule update -q --init tools/inspect
49-
- cp -r $TRAVIS_BUILD_DIR/* libs/$SELF
50-
- export BOOST_ROOT="`pwd`"
51-
- export PATH="`pwd`":$PATH
52-
- python tools/boostdep/depinst/depinst.py $SELF --include example
53-
- ./bootstrap.sh
54-
- ./b2 headers
38+
- git clone https://github.com/jeking3/boost-ci.git boost-ci
39+
- cp -pr boost-ci/ci boost-ci/.codecov.yml .
40+
- source ci/travis/install.sh
5541

5642
addons:
5743
apt:
@@ -66,79 +52,105 @@ branches:
6652
- master
6753

6854
script:
69-
- cd libs/$SELF
70-
- ci/build.sh
55+
- cd $BOOST_ROOT/libs/$SELF
56+
- ci/travis/build.sh
57+
58+
#
59+
# Default toolsets in Ubuntu
60+
#
61+
# trusty xenial bionic
62+
# 14.04 16.04 18.04
63+
# ------ ------ ------
64+
# clang 3.4 3.8 6.0
65+
# gcc 4.8.2 5.3.1 7.3.0
66+
#
67+
68+
anchors:
69+
clang-34: &clang-34 { apt: { packages: [ "clang-3.4" ], sources: [ "llvm-toolchain-trusty-3.4" ] } }
70+
clang-38: &clang-38 { apt: { packages: [ "clang-3.8" ], sources: [ "llvm-toolchain-trusty-3.8" ] } }
71+
clang-4: &clang-4 { apt: { packages: [ "clang-4.0" ], sources: [ "llvm-toolchain-trusty-4.0" ] } }
72+
clang-5: &clang-5 { apt: { packages: [ "clang-5.0" ], sources: [ "llvm-toolchain-trusty-5.0" ] } }
73+
clang-6: &clang-6 { apt: { packages: [ "clang-6.0",
74+
"libstdc++-7-dev",
75+
"valgrind" ], sources: [ "llvm-toolchain-trusty-6.0",
76+
"ubuntu-toolchain-r-test" ] } }
77+
gcc-44: &gcc-44 { apt: { packages: [ "g++-4.4" ], sources: [ "ubuntu-toolchain-r-test" ] } }
78+
gcc-46: &gcc-46 { apt: { packages: [ "g++-4.6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
79+
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
80+
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ], sources: [ "ubuntu-toolchain-r-test" ] } }
81+
gcc-6: &gcc-6 { apt: { packages: [ "g++-6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
82+
gcc-7: &gcc-7 { apt: { packages: [ "g++-7" ], sources: [ "ubuntu-toolchain-r-test" ] } }
83+
gcc-8: &gcc-8 { apt: { packages: [ "g++-8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
7184

7285
jobs:
7386
include:
87+
# libstdc++
88+
- { os: "linux", env: [ "TOOLSET=gcc-4.4", "CXXSTD=98,0x" ], addons: *gcc-44 }
89+
- { os: "linux", env: [ "TOOLSET=gcc-4.6", "CXXSTD=03,0x" ], addons: *gcc-46 }
90+
- { os: "linux", env: [ "TOOLSET=gcc-4.8", "CXXSTD=03,11" ], addons: *gcc-48 }
91+
- { os: "linux", env: [ "TOOLSET=gcc-5", "CXXSTD=03,11" ], addons: *gcc-5 }
92+
- { os: "linux", env: [ "TOOLSET=gcc-6", "CXXSTD=03,11,14" ], addons: *gcc-6 }
93+
- { os: "linux", env: [ "TOOLSET=gcc-7", "CXXSTD=03,11,14,17" ], addons: *gcc-7 }
94+
- { os: "linux", env: [ "TOOLSET=gcc-8", "CXXSTD=03,11,14,17,2a" ], addons: *gcc-8 }
95+
- { os: "linux", env: [ "TOOLSET=clang-3.4", "CXXSTD=03,11,14" ], addons: *clang-34 }
96+
- { os: "linux", env: [ "TOOLSET=clang-3.8", "CXXSTD=03,11,14" ], addons: *clang-38 }
97+
- { os: "linux", env: [ "TOOLSET=clang-4.0", "CXXSTD=03,11,14" ], addons: *clang-4 }
98+
- { os: "linux", env: [ "TOOLSET=clang-5.0", "CXXSTD=03,11,14,17" ], addons: *clang-5 }
99+
- { os: "linux", env: [ "TOOLSET=clang-6.0", "CXXSTD=03,11,14,17,2a" ], addons: *clang-6 }
100+
# libc++
101+
# the rvm environment on osx is taking over basic commands like "cd" and breaking things
102+
# - { os: "osx" , env: [ "COMMENT=libc++",
103+
# "TOOLSET=clang", "CXXSTD=03,11,14" ] }
104+
74105
- os: linux
75106
env:
76-
- COMMENT="C++03"
77-
- TOOLSET=gcc,gcc-7
78-
addons:
79-
apt:
80-
packages:
81-
- g++-7
82-
sources:
83-
- ubuntu-toolchain-r-test
107+
- COMMENT=codecov.io
108+
- TOOLSET=gcc-7
109+
addons: *gcc-7
110+
script:
111+
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && export PATH=/tmp/lcov/bin:$PATH && which lcov && lcov --version && popd
112+
- cd $BOOST_ROOT/libs/$SELF
113+
- ci/travis/codecov.sh
114+
84115
- os: linux
85-
env:
86-
- COMMENT="C++11"
87-
- TOOLSET=clang
88-
- CXXSTD=11
89-
addons:
90-
apt:
91-
packages:
92-
- g++-7
93-
sources:
94-
- ubuntu-toolchain-r-test
116+
env:
117+
- COMMENT=cppcheck
118+
script:
119+
- cd $BOOST_ROOT/libs/$SELF
120+
- ci/travis/cppcheck.sh
121+
95122
- os: linux
96-
env:
97-
- COMMENT=valgrind
98-
- TOOLSET=clang
123+
env:
124+
- COMMENT=ubsan
99125
- B2_VARIANT=variant=debug
100-
- TESTFLAGS=testing.launcher=valgrind
101-
addons:
102-
apt:
103-
packages:
104-
- clang-5.0
105-
- libstdc++-7-dev
106-
- valgrind
107-
sources:
108-
- llvm-toolchain-trusty-5.0
109-
- ubuntu-toolchain-r-test
126+
- TOOLSET=gcc-8
127+
- CXXFLAGS="cxxflags=-fno-omit-frame-pointer cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined"
128+
- LINKFLAGS="linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined linkflags=-fuse-ld=gold"
129+
- UBSAN_OPTIONS=print_stacktrace=1
130+
addons: *gcc-8
110131

111132
- os: linux
112133
env:
113-
- COMMENT=cppcheck
114-
script:
115-
- libs/$SELF/ci/cppcheck.sh
134+
- COMMENT=valgrind
135+
- TOOLSET=clang-6.0
136+
- CXXSTD=03
137+
- B2_VARIANT=variant=debug
138+
- TESTFLAGS=testing.launcher=valgrind
139+
- VALGRIND_OPTS=--error-exitcode=1
140+
addons: *clang-6
141+
142+
#################### Jobs to run on pushes to master, develop ###################
116143

144+
# Coverity Scan
117145
- os: linux
118-
env:
119-
- COMMENT=CodeCov
146+
if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push))
147+
env:
148+
- COMMENT="Coverity Scan"
120149
- TOOLSET=gcc-7
121-
addons:
122-
apt:
123-
packages:
124-
- gcc-7
125-
- g++-7
126-
sources:
127-
- ubuntu-toolchain-r-test
150+
addons: *gcc-7
128151
script:
129-
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && cd lcov && sudo make install && which lcov && lcov --version && popd
130-
- cd libs/$SELF
131-
- ci/codecov.sh
132-
133-
#################### Jobs to run on every pull request ####################
134-
# osx was disabled because it is very slow to start (can delay builds by 30 minutes)
135-
# - os: osx
136-
# osx_image: xcode9
137-
# env:
138-
# - TOOLSET=clang
139-
# - CXXSTD=03,11
140-
141-
#################### Jobs to run on pushes to master, develop ###################
152+
- cd $BOOST_ROOT/libs/$SELF
153+
- ci/travis/coverity.sh
142154

143155
notifications:
144156
email:

0 commit comments

Comments
 (0)