forked from Exiv2/exiv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoverity.sh
executable file
·62 lines (49 loc) · 1.75 KB
/
coverity.sh
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
#!/bin/sh
# Copyright (c) 2013-2015, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Before to run this script you must set these shell variable :
# $EXIVCoverityToken with token of Exiv2 project given by Coverity SCAN
# $EXIVCoverityEmail with email adress to send SCAN result.
#
# Coverity Scan bin dir must be appended to PATH variable.
#
# See this url to see how to prepare your computer with Coverity SCAN tool:
# http://scan.coverity.com/projects/297/upload_form
cd ..
# Manage build sub-dir
if [ -d "build.cmake" ]; then
rm -rfv ./build.cmake
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
./bootstrap.linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
./bootstrap.macports
else
echo "Unsupported platform..."
exit -1
fi
# Get active svn branch path to create SCAN import description string
svn info | grep "URL" | sed '/svn/{s/.*\(svn.*\)/\1/};' > ./build.cmake/svn_branch.txt
desc=$(<build.cmake/svn_branch.txt)
cd ./build.cmake
cov-build --dir cov-int --tmpdir ~/tmp make -j8
tar czvf myproject.tgz cov-int
echo "-- SCAN Import description --"
echo $desc
echo "-----------------------------"
echo "Coverity Scan tarball 'myproject.tgz' uploading in progress..."
nslookup scan5.coverity.com
SECONDS=0
curl -# \
--form token=$EXIVCoverityToken \
--form email=$EXIVCoverityEmail \
--form [email protected] \
--form version=svn-trunk \
--form description="$desc" \
https://scan.coverity.com/builds?project=Exiv2 \
> /dev/null
echo "Done. Coverity Scan tarball 'myproject.tgz' is uploaded and ready for analyse."
echo "That took approximately $SECONDS seconds to upload."