Skip to content

Commit 177a13d

Browse files
author
Vlastimil Zeman
committed
Add Coverity scan
Coverity scan will run as separate job in second stage. Ii will terminate itself as soon as possible if build is not triggered by cron. Therefore it requires to have cron job setup in settings of diffblue/cbmc and environment variable `COVERITY_SCAN_TOKEN` in the same project settings.
1 parent a400c23 commit 177a13d

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,43 @@ jobs:
127127
- cmake --build build -- -j4
128128
script: (cd build; ctest -V -L CORE)
129129

130+
# Run Coverity
131+
- stage: Test different OS/CXX/Flags
132+
os: linux
133+
sudo: required
134+
compiler: gcc
135+
cache: ccache
136+
addons:
137+
apt:
138+
sources:
139+
- ubuntu-toolchain-r-test
140+
packages:
141+
- libwww-perl
142+
- g++-5
143+
coverity_scan:
144+
project:
145+
name: "diffblue/cbmc"
146+
description: "Travis build of ${TRAVIS_COMMIT}"
147+
notification_email: "coverity-scan@diffblue.com"
148+
build_command_prepend: "make -C src minisat2-download"
149+
build_command: "make -C src -j2"
150+
branch_pattern: "develop"
151+
before_install:
152+
- |
153+
if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]
154+
then
155+
echo "This is not a cron build and build is not needed."
156+
travis_terminate 0
157+
fi
158+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
159+
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 90
160+
- g++ --version
161+
# Coverity runs as part of before_script
162+
env:
163+
- NAME="COVERITY_SCAN"
164+
- COMPILER="ccache g++"
165+
script: echo "This is coverity build. No need for tests."
166+
130167
allow_failures:
131168
- <<: *linter-stage
132169

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build Status][travis_img]][travis] [![Build Status][appveyor_img]][appveyor]
2+
[![Build Status][coverity_img]][coverity]
23

34
[CProver Wiki](http://www.cprover.org/wiki)
45

@@ -47,4 +48,6 @@ License
4748
[travis]: https://travis-ci.org/diffblue/cbmc
4849
[travis_img]: https://travis-ci.org/diffblue/cbmc.svg?branch=master
4950
[appveyor]: https://ci.appveyor.com/project/diffblue/cbmc/
50-
[appveyor_img]: https://ci.appveyor.com/api/projects/status/github/diffblue/cbmc?svg=true&branch=master
51+
[appveyor_img]: https://ci.appveyor.com/api/projects/status/github/diffblue/cbmc?svg=true&branch=master
52+
[coverity]: https://scan.coverity.com/projects/diffblue-cbmc
53+
[coverity_img]: https://scan.coverity.com/projects/13552/badge.svg

0 commit comments

Comments
 (0)