forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
373 lines (353 loc) · 11.7 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
language: cpp
jobs:
include:
- &formatting-stage
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env: NAME="clang-format"
addons:
apt:
sources:
- llvm-toolchain-trusty-7
- ubuntu-toolchain-r-test
packages:
- clang-format-7
install:
script: |
clang-format-7 --version
# build a pathspec that excludes the files in .clang-format-ignore
while read file ; do echo EXCLUDES+="':(top,exclude)$file' " ; done < .clang-format-ignore
MERGE_BASE=$(git merge-base ${TRAVIS_COMMIT_RANGE%...*} ${TRAVIS_COMMIT_RANGE#*...})
echo "Checking for formatting errors introduced since $MERGE_BASE"
git-clang-format-7 --binary clang-format-7 $MERGE_BASE -- $EXCLUDES
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:
- &string-table-check
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env: NAME="string-table"
install:
script: scripts/string_table_check.sh
before_cache:
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
env:
NAME: "DOXYGEN-CHECK"
DOXYGEN_VERSION: "1.8.14"
addons:
apt:
sources:
- sourceline: 'deb http://packages.cloud.google.com/apt cloud-sdk-trusty main'
key_url: 'https://packages.cloud.google.com/apt/doc/apt-key.gpg'
packages:
- cmake
- google-cloud-sdk
- graphviz
cache:
directories:
- ${TRAVIS_BUILD_DIR}/doxygen/build/bin
install:
- |
# Build doxygen if it is not in Travis cache
if ! [ -x doxygen/build/bin/doxygen ]
then
scripts/build_doxygen.sh ${DOXYGEN_VERSION}
fi
- export PATH="$PATH:${TRAVIS_BUILD_DIR}/doxygen/build/bin"
script:
- echo $PATH
- doxygen --version
- scripts/run_doxygen.sh
before_cache:
after_success:
# Google Cloud Integration
- export BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- openssl aes-256-cbc -k ${GCLOUD_TRAVIS_CBMC_KEY}
-in gcloud-travis-cbmc.json.enc -out gcloud-travis-cbmc.json -d
- export G_KEY=${PWD}/gcloud-travis-cbmc.json
- gcloud auth activate-service-account --key-file ${G_KEY}
- scripts/publish_doc.sh
# Ubuntu Linux with glibc using g++-5
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
os: linux
dist: trusty
sudo: false
compiler: gcc
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libwww-perl
- g++-5
- libubsan0
- parallel
- jq
- gdb
before_install:
- mkdir bin
- ln -s /usr/bin/gcc-5 bin/gcc
- ln -s /usr/bin/g++-5 bin/g++
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env:
- COMPILER="ccache /usr/bin/g++-5"
- WITH_MEMORY_ANALYZER=1
# 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 parallel gdb
- export PATH=$PATH:/usr/local/opt/ccache/libexec
env:
- COMPILER="ccache clang++"
- WITH_MEMORY_ANALYZER=0
# Ubuntu Linux with glibc using g++-5, debug mode
- stage: Test different OS/CXX/Flags
os: linux
dist: trusty
sudo: false
compiler: gcc
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libwww-perl
- g++-5
- libubsan0
- jq
- gdb
before_install:
- mkdir bin
- ln -s /usr/bin/gcc-5 bin/gcc
- ln -s /usr/bin/g++-5 bin/g++
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env:
- COMPILER="ccache /usr/bin/g++-5"
- EXTRA_CXXFLAGS="-DDEBUG"
- WITH_MEMORY_ANALYZER=1
script: echo "Not running any tests for a debug build."
# Ubuntu Linux with glibc using clang++-7, debug mode, disable USE_DSTRING
- stage: Test different OS/CXX/Flags
os: linux
dist: trusty
sudo: false
compiler: clang
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
packages:
- libwww-perl
- g++-5
- clang-7
- libstdc++-5-dev
- libubsan0
- jq
- gdb
before_install:
- mkdir bin
- ln -s /usr/bin/gcc-5 bin/gcc
- ln -s /usr/bin/g++-5 bin/g++
- export CCACHE_CPP2=yes
# env: COMPILER=clang++-7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env:
- COMPILER="ccache /usr/bin/clang++-7"
- EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DDEBUG -DUSE_STD_STRING"
- CCACHE_CPP2=yes
- WITH_MEMORY_ANALYZER=1
script: echo "Not running any tests for a debug build."
# cmake build using g++-7, enable NAMED_SUB_IS_FORWARD_LIST
- stage: Test different OS/CXX/Flags
os: linux
dist: trusty
sudo: false
compiler: gcc
cache: ccache
env:
- BUILD_SYSTEM=cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- jq
- gdb
before_install:
- mkdir bin
- ln -s /usr/bin/gcc-7 bin/gcc
- ln -s /usr/bin/g++-7 bin/g++
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-7' '-DCMAKE_CXX_FLAGS=-DNAMED_SUB_IS_FORWARD_LIST' '-DWITH_MEMORY_ANALYZER=On'
- git submodule update --init --recursive
- cmake --build build -- -j4
script: (cd build; bin/unit "[core][irept]")
# cmake build using g++-7, enable CMAKE_USE_CUDD and BDD_GUARDS
- stage: Test different OS/CXX/Flags
os: linux
dist: trusty
sudo: false
compiler: gcc
cache: ccache
env:
- BUILD_SYSTEM=cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- jq
- gdb
before_install:
- mkdir bin
- ln -s /usr/bin/gcc-7 bin/gcc
- ln -s /usr/bin/g++-7 bin/g++
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-7' '-DCMAKE_USE_CUDD=true' -DCMAKE_CXX_FLAGS="-DBDD_GUARDS" '-DWITH_MEMORY_ANALYZER=On'
- git submodule update --init --recursive
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
# cmake build using clang++-6
- stage: Test different OS/CXX/Flags
os: linux
dist: trusty
sudo: false
compiler: clang
cache: ccache
env:
- BUILD_SYSTEM=cmake
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
packages:
- libwww-perl
- g++-5
- clang-7
- libstdc++-5-dev
- libubsan0
- parallel
- jq
- gdb
before_install:
- mkdir bin
# Use gcc/g++ 5 for tests, as Clang doesn't work yet
# See https://github.com/diffblue/cbmc/issues/2370 for details.
- ln -s /usr/bin/gcc-5 bin/gcc-5
- ln -s /usr/bin/g++-5 bin/g++-5
install:
- ccache -z
- ccache --max-size=1G
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/clang++-7' '-DCMAKE_CXX_FLAGS=-Qunused-arguments' '-DWITH_MEMORY_ANALYZER=On'
- git submodule update --init --recursive
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
# cmake build on OSX, using default 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 gdb
- export PATH=$PATH:/usr/local/opt/ccache/libexec
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'
- git submodule update --init --recursive
- cmake --build build -- -j4
script: (cd build; ctest -V -L CORE -j2)
# Run Coverity
- stage: Test different OS/CXX/Flags
if: type = cron
os: linux
dist: trusty
sudo: false
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 jbmc/src setup-submodules"
build_command_prepend: "make -C src minisat2-download"
build_command: "make -C src -j2; make -C jbmc/src -j2"
branch_pattern: "develop"
before_install:
- 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++"
- WITH_MEMORY_ANALYZER=1
script: echo "This is coverity build. No need for tests."
install:
- ccache -z
- ccache --max-size=1G
- make -C jbmc/src setup-submodules
- make -C src minisat2-download
- make -C src/ansi-c library_check
- make -C src/cpp library_check
- make -C src "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j3
- make -C jbmc/src "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j3
script:
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test-parallel "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2 JOBS=2
- UBSAN_OPTIONS=print_stacktrace=1 make -C regression/cbmc test-paths-lifo
- env PATH=$PATH:`pwd`/src/solvers UBSAN_OPTIONS=print_stacktrace=1 make -C regression/cbmc test-cprover-smt2
- make -C unit "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2
- make -C unit test
- env UBSAN_OPTIONS=print_stacktrace=1 make -C jbmc/regression test-parallel "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2 JOBS=2
- make -C jbmc/unit "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2
- make -C jbmc/unit test
before_cache:
- ccache -s
notifications:
webhooks:
urls:
- http://dashboard.diffblue.com/api/travis-webhooks
- https://us-central1-dev-user-joelallred.cloudfunctions.net/trigger-testgen-from-cbmc
on_success: always
on_failure: always
on_start: never
on_cancel: never
on_error: always