summaryrefslogtreecommitdiffstats
path: root/src/civetweb/resources/coverity_check.sh
blob: 063d7c8c2924bf8b54a0667ae019d0d582a0fa63 (plain)
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
#! /bin/sh

# check if we use the correct directory
ls src/civetweb.c
if [ "$?" = "0" ]; then
	echo "Building files for coverity check ..."
else
	echo "Run this script from the root directory of project!" 1>&2
	echo "username@hostname:/somewhere/civetweb$ ./resources/coverity_check.sh" 1>&2
	exit 1
fi

# remove last build
rm -rf cov_build/

# copy files to build folder
mkdir cov_build
mkdir cov_build/src
mkdir cov_build/include
mkdir cov_build/resources

cp Makefile cov_build/
cp src/*.c cov_build/src/
cp src/*.inl cov_build/src/
cp include/civetweb.h cov_build/include/
cp resources/Makefile.in-os cov_build/resources/

cd cov_build

# new scan build
../../cov-analysis-linux64-8.7.0/bin/cov-build  --dir cov-int make WITH_IPV6=1 WITH_WEBSOCKET=1 WITH_SERVER_STATS=1


# pack build results for upload
tar czvf civetweb_coverity_check.tgz cov-int

cd ..

# check if the build was successful
echo
ls -la cov_build/civetweb_coverity_check.tgz

if [ "$?" = "0" ]; then
	echo "... done"
	echo
        echo "submit to https://scan.coverity.com/projects/bel2125-civetweb"
	echo
	echo "last commit was"
	git log -n 1
        echo
        echo
else
	echo "No civetweb_coverity_check.tgz file" 1>&2
        echo
	exit 1
fi

# return "ok"
exit 0