File: coverage.sh

package info (click to toggle)
pgbouncer 1.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,884 kB
  • sloc: ansic: 61,425; python: 5,703; sh: 4,527; makefile: 1,361; sed: 22
file content (31 lines) | stat: -rwxr-xr-x 628 bytes parent folder | download
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
#! /bin/sh

set -e

test -f test_common.h || {
  echo "wrong dir"
  exit 1
}

cd ..

rm -rf .objs test/.objs
rm -rf test/lcov/*

make -C test test_config.h
make -f test/coverage.mk CC="gcc -fprofile-arcs -ftest-coverage" CFLAGS="-O0 -g"

./covtest || true

echo 'Running lcov'
lcov -q --capture --directory .objs/covtest -b . --output-file coverage.info.tmp

echo 'Fixing filenames'
sed -e '/SF:/s,/\./,/,' coverage.info.tmp > coverage.info

echo 'Running genhtml'
genhtml -q coverage.info --output-directory test/lcov
echo 'Result: test/lcov/index.html'
rm -f coverage.info.tmp coverage.info
rm -f covtest
rm -rf .objs/covtest