summaryrefslogtreecommitdiff
path: root/citools
diff options
context:
space:
mode:
authorVincent Sanders <vincent.sanders@collabora.co.uk>2013-11-16 10:56:54 +0000
committerVincent Sanders <vincent.sanders@collabora.co.uk>2013-11-16 10:56:54 +0000
commit976aa3abca16a4d40cac238cea1bebe4218978cc (patch)
treef3a5133a11ffa2a5a3f22afdc8a02c978d168383 /citools
parent2c7eb2a9710710079c39419c4838d81a320c1a70 (diff)
downloadbuildsystem-976aa3abca16a4d40cac238cea1bebe4218978cc.tar.gz
buildsystem-976aa3abca16a4d40cac238cea1bebe4218978cc.tar.bz2
add coverity target
Diffstat (limited to 'citools')
-rwxr-xr-xcitools/jenkins-build.sh38
1 files changed, 36 insertions, 2 deletions
diff --git a/citools/jenkins-build.sh b/citools/jenkins-build.sh
index 90ac9b1..3ec0de6 100755
--- a/citools/jenkins-build.sh
+++ b/citools/jenkins-build.sh
@@ -29,7 +29,8 @@
# install - build and install
# test-install - build, test and install
# coverage - run coverage
-# static - perform a staic anaysis
+# static - perform a static analysis
+# coverity - perform a coverity scan
# TARGET must be in the environment and set correctly
if [ "x${TARGET}" = "x" ];then
@@ -51,6 +52,7 @@ TARGET_TEST=
TARGET_INSTALL=
TARGET_COVERAGE=
TARGET_STATIC=
+TARGET_COVERITY=
TARGET_BUILD="release"
# change defaults based on build parameter
@@ -73,6 +75,13 @@ case "$1" in
export CCACHE=
;;
+ "coverity")
+ TARGET_COVERITY=${TARGET}
+ TARGET_BUILD="debug"
+ # need to disable ccache on coverity builds
+ export CCACHE=
+ ;;
+
"test-install")
# Perfom test if being executed on native target
TARGET_TEST=${NATIVE_TARGET}
@@ -94,7 +103,8 @@ Usage: jenkins-build.sh [install|test-install|coverage|static]
install build and install
test-install build, test and install
coverage run coverage
- static perform a staic anaysis
+ static perform a static anaysis
+ coverity perform a coverity scan
EOF
exit 1
;;
@@ -149,6 +159,30 @@ elif [ "x${TARGET}" = "x${TARGET_STATIC}" ]; then
# clean up after
make Q= clean TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}
+elif [ "x${TARGET}" = "x${TARGET_COVERITY}" ]; then
+ # coverity build
+
+ # COVERITY_TOKEN
+ # COVERITY_USER
+ # COVERITY_PREFIX
+
+ # Coverity tools location
+ COVERITY_PREFIX=${COVERITY_PREFIX:-/opt/coverity/cov-analysis-linux64-6.6.1}
+ COVERITY_VERSION=$(git rev-parse HEAD)
+
+ export PATH=${PATH}:${COVERITY_PREFIX}/bin
+
+ # cleanup before we start
+ rm -rf cov-int/ coverity-scan.tar.gz coverity-scan.tar
+
+ cov-build --dir cov-int make Q= clean TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}
+
+ tar cf coverity-scan.tar
+
+ gzip -9 coverity-scan.tar
+
+ curl --form "project=NetSurf" --form "token=${COVERITY_TOKEN}" --form "email=${COVERITY_USER}" --form "file=@coverity-scan.tar.gz" --form "version=${COVERITY_VERSION}" --form "description=Git Head build" http://scan5.coverity.com/cgi-bin/upload.py
+
else
# Normal build
make Q= TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}