Skip to content

Commit

Permalink
cov settings
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Oct 10, 2019
1 parent 070449f commit 81c1625
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .coverity.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
39 changes: 31 additions & 8 deletions covbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions covconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 81c1625

Please sign in to comment.