forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
241 lines (223 loc) · 7.4 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
language: cpp
jobs:
include:
- &formatting-stage
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env: NAME="clang-format"
addons:
apt:
packages:
- clang-format-3.8
install:
script: |
# Apparently update-alternatives doesn't work in Travis containers
mkdir -p priority-symlinks
ln -s /usr/bin/clang-format-3.8 priority-symlinks/clang-format
export PATH=${PWD}/priority-symlinks:${PATH}
# Now we can do the formatting pass
clang-format --version
git-clang-format-3.8 "${TRAVIS_BRANCH}"
git diff > formatted.diff
if [[ -s formatted.diff ]] ; then
echo 'Formatting error! The following diff shows the required changes'
echo 'Use the raw log to get a version of the diff that preserves spacing'
cat formatted.diff
exit 1
fi
echo 'No formatting errors found'
exit 0
before_cache:
- &linter-stage
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env: NAME="CPP-LINT"
install:
script: scripts/travis_lint.sh
before_cache:
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env: NAME="DOXYGEN-CHECK"
addons:
apt:
packages:
- doxygen
install:
script: scripts/travis_doxygen.sh
before_cache:
# Ubuntu Linux with glibc using g++-5
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
os: linux
sudo: false
compiler: gcc
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libwww-perl
- g++-5
- libubsan0
before_install:
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env:
- COMPILER="ccache g++-5"
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG"
# OS X using g++
- stage: Test different OS/CXX/Flags
os: osx
sudo: false
compiler: gcc
cache: ccache
before_install:
#we create symlink to non-ccache gcc, to be used in tests
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
env: COMPILER="ccache g++"
# OS X using clang++
- stage: Test different OS/CXX/Flags
os: osx
sudo: false
compiler: clang
cache: ccache
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
env:
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
# Ubuntu Linux with glibc using clang++-3.7, no-debug mode
- stage: Test different OS/CXX/Flags
os: linux
sudo: false
compiler: clang
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- libwww-perl
- clang-3.7
- libstdc++-5-dev
- libubsan0
before_install:
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
- export CCACHE_CPP2=yes
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env:
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
- EXTRA_CXXFLAGS="-DNDEBUG"
# Ubuntu Linux with glibc using clang++-3.7, debug mode, disable USE_DSTRING
- stage: Test different OS/CXX/Flags
os: linux
sudo: false
compiler: clang
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- libwww-perl
- clang-3.7
- libstdc++-5-dev
- libubsan0
before_install:
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
- export CCACHE_CPP2=yes
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env:
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
- CCACHE_CPP2=yes
- EXTRA_CXXFLAGS="-DDEBUG -DUSE_STD_STRING"
script: echo "Not running any tests for a debug build."
# cmake build using g++-5
- stage: Test different OS/CXX/Flags
os: linux
cache: ccache
env:
- BUILD_SYSTEM=cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
- stage: Test different OS/CXX/Flags
os: osx
cache: ccache
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- export PATH=/usr/local/opt/ccache/libexec:$PATH
env:
- BUILD_SYSTEM=cmake
- CCACHE_CPP2=yes
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=x86_64'
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
# Run Coverity
- stage: Test different OS/CXX/Flags
os: linux
sudo: required
compiler: gcc
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libwww-perl
- g++-5
coverity_scan:
project:
name: "diffblue/cbmc"
description: "Travis build of ${TRAVIS_COMMIT}"
notification_email: "[email protected]"
build_command_prepend: "make -C src minisat2-download"
build_command: "make -C src -j2"
branch_pattern: "develop"
before_install:
- |
if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]
then
echo "This is not a cron build and build is not needed."
travis_terminate 0
fi
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 90
- g++ --version
# Coverity runs as part of before_script
env:
- NAME="COVERITY_SCAN"
- COMPILER="ccache g++"
script: echo "This is coverity build. No need for tests."
allow_failures:
- <<: *formatting-stage
- <<: *linter-stage
install:
- ccache -z
- ccache --max-size=1G
- make -C src minisat2-download
- make -C src/ansi-c library_check
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2 clobber.dir memory-models.dir
script:
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
- make -C unit "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
- make -C unit test
before_cache:
- ccache -s