cov settings

This commit is contained in:
Philippe Teuwen 2019-10-10 14:52:51 +02:00
parent 070449f7d2
commit 81c1625bfc
3 changed files with 39 additions and 9 deletions

View file

@ -4,9 +4,13 @@ COVTOKEN=aAbBcCdDeEfFgGhHiIjJkK
COVBINDIR="/opt/cov-analysis-linux64-2019.03/bin"
# Nickname included in scan description:
NICKNAME=myself
# cov can't read gcov from gcc > 7
HOSTCC=gcc-7
HOSTCXX=g++-7
HOSTLD=g++-7
# Do not change it:
COVDIR=cov-int
COVBUILD="cov-build --dir $COVDIR"
# Depending if your kernel > 4.8.x, you might need to activate this to run Coverity executables
# (but latest tools with kernel 5.2 run fine)

View file

@ -5,16 +5,39 @@ set -e
pre_build_hook
rm -rf "$COVDIR"
mkdir "$COVDIR"
mkdir -p "$COVDIR"
make clean
$COVBUILD make -j 4 bootrom
$COVBUILD make -j 4 fullimage
$COVBUILD make -j 4 mfkey
$COVBUILD make -j 4 nonce2key
$COVBUILD make -j 4 fpga_compress
cov-build --dir "$COVDIR" --initialize
#########################################
# Build Host prerequisites #
#########################################
cov-build --dir "$COVDIR" --c-coverage=gcov --no-network-coverage --no-generate-build-id --force make CC=$HOSTCC CXX=$HOSTCXX LD=$HOSTLD fpga_compress
#########################################
# Build ARM, no test coverage #
#########################################
cov-build --dir "$COVDIR" --no-generate-build-id --force make bootrom
cov-build --dir "$COVDIR" --no-generate-build-id --force make fullimage
#########################################
# Build client #
#########################################
# make sure to do client after ARM because Coverity retains one build info per file
# and we want the client-side of the common/ analysis
$COVBUILD make -j 4 client
cov-build --dir "$COVDIR" --c-coverage=gcov --no-network-coverage --no-generate-build-id --force make CC=$HOSTCC CXX=$HOSTCXX LD=$HOSTLD mfkey
cov-build --dir "$COVDIR" --c-coverage=gcov --no-network-coverage --no-generate-build-id --force make CC=$HOSTCC CXX=$HOSTCXX LD=$HOSTLD nonce2key
cov-build --dir "$COVDIR" --c-coverage=gcov --no-network-coverage --no-generate-build-id --force make CC=$HOSTCC CXX=$HOSTCXX LD=$HOSTLD client
#########################################
# Run tests #
#########################################
cov-build --dir "$COVDIR" --c-coverage=gcov --no-network-coverage --test-capture ./pm3test.sh
#cov-manage-emit --dir "$COVDIR" list-coverage-known
#########################################
# Import Git annotations (~ git blame) #
#########################################
cov-import-scm --dir "$COVDIR" --scm git --filename-regex "$PWD" --log ""$COVDIR"/cov-import-scm-log.txt"
post_build_hook

View file

@ -3,4 +3,7 @@
set -e
. .coverity.conf || exit 1
# cov-configure --list-configured-compilers text
cov-configure --template --compiler arm-none-eabi-gcc --comptype gcc
# cov can't read gcov from gcc > 7
cov-configure --template --compiler $HOSTCC --comptype gcc