Skip to content

Commit cdcf768

Browse files
committed
Test: Travis: Handle coverity as a new compiler
1 parent 56955cf commit cdcf768

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.travis.yml

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Control file for the Travis autobuilder
2-
# http://about.travis-ci.org/docs/user/build-configuration/
2+
# http://docs.travis-ci.com/user/build-configuration/
33

44
language: c
55
compiler:
66
- gcc
77
- clang
8+
- cov-build
89

910
env:
1011
global:
@@ -14,8 +15,6 @@ env:
1415
# The build command with all of the arguments that you would apply to a manual `cov-build`
1516
- COVERITY_SCAN_BUILD_COMMAND="make"
1617

17-
- PROJECT_NAME="ClusterLabs/pacemaker"
18-
1918
# Email address for notifications related to this build
2019
- OWNER_EMAIL="[email protected]"
2120

@@ -28,16 +27,9 @@ env:
2827

2928
# -- END Coverity Scan ENV
3029

31-
# http://docs.travis-ci.com/user/build-configuration/#The-Build-Matrix
32-
matrix:
33-
- COVERITY_SCAN=0
34-
- COVERITY_SCAN=1
35-
3630
# sudo add-apt-repository ppa:hotot-team
3731
before_install:
38-
- whoami
39-
- env | sort
40-
- sudo bash -c 'echo "deb http://archive.ubuntu.com/ubuntu/ raring universe" >> /etc/apt/sources.list'
32+
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ raring universe"
4133
- sudo apt-get update -qq
4234

4335
install:
@@ -46,20 +38,25 @@ install:
4638
- sudo apt-get install -qq libqb-dev/raring
4739

4840
before_script:
41+
# Save and restore CC so that ./configure can pass
42+
- export CC_SAVED=$CC
43+
- export CC=`echo ${CC} | sed s/cov-build/gcc/`
4944
- ./autogen.sh
5045
- ./configure
46+
- export CC=$CC_SAVED
5147

5248
script:
53-
- if test ${COVERITY_SCAN} = 0; then make; fi
54-
- if test ${COVERITY_SCAN} = 1; then bash travisci_build_coverity_scan.sh; fi
49+
- if test ${CC} != cov-build; then make && ./BasicSanity.sh -V; fi
50+
- if test ${CC} = cov-build; then export CC=gcc; bash ./travisci_build_coverity_scan.sh; fi
5551

5652
#after_script:
57-
after_success:
58-
- if test ${COVERITY_SCAN} = 0; then ./BasicSanity.sh -V; fi
53+
#after_success:
5954

6055
after_failure:
6156
- lsb_release -a
6257
- sudo cat /etc/apt/sources.list
58+
- whoami
59+
- env | sort
6360

6461
notifications:
6562
irc: "irc.freenode.org#pcmk"

travisci_build_coverity_scan.sh

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set -e
55
export RED="\033[33;1m"
66
export NONE="\033[0m"
77

8+
if [ -z "$PROJECT_NAME" ]; then
9+
PROJECT_NAME=${TRAVIS_REPO_SLUG}
10+
fi
11+
812
# Environment check
913
echo -e "${RED}Note: PROJECT_NAME and COVERITY_SCAN_TOKEN are available on Project Settings page on scan.coverity.com${NONE}"
1014
[ -z "$PROJECT_NAME" ] && echo "ERROR: PROJECT_NAME must be set" && exit 1

0 commit comments

Comments
 (0)