File: view-coverage.sh

package info (click to toggle)
libpsl 0.21.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 46,848 kB
  • sloc: ansic: 2,450; python: 515; sh: 309; makefile: 262
file content (21 lines) | stat: -rwxr-xr-x 780 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash -eu

# 1. execute 'make fuzz-coverage' in the top directory
# 2. execute './view-coverage.sh <fuzz target>
#    example: ./view-coverage.sh libpsl_fuzzer

if test -z "$1"; then
  echo "Usage: $0 <fuzz target>"
  echo "Example: $0 libpsl_fuzzer"
  exit 1
fi

fuzzer="./"$1
LCOV_INFO=coverage.info
#make fuzz-coverage CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
./coverage.sh $fuzzer
lcov --capture --initial --directory ../src --directory . --output-file $LCOV_INFO
lcov --capture --directory ../src --output-file $LCOV_INFO
#lcov --remove $LCOV_INFO '*/test_linking.c' '*/css_tokenizer.lex' '*/<stdout>' '*/*.h' -o $LCOV_INFO
genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$1" --output-directory=lcov
xdg-open lcov/index.html