• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -eu
2
3# 1. execute 'make fuzz-coverage' in the top directory
4# 2. execute './view-coverage.sh <fuzz target>
5#    example: ./view-coverage.sh libpsl_fuzzer
6
7if test -z "$1"; then
8  echo "Usage: $0 <fuzz target>"
9  echo "Example: $0 libpsl_fuzzer"
10  exit 1
11fi
12
13fuzzer="./"$1
14LCOV_INFO=coverage.info
15#make fuzz-coverage CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
16./coverage.sh $fuzzer
17lcov --capture --initial --directory ../src --directory . --output-file $LCOV_INFO
18lcov --capture --directory ../src --output-file $LCOV_INFO
19#lcov --remove $LCOV_INFO '*/test_linking.c' '*/css_tokenizer.lex' '*/<stdout>' '*/*.h' -o $LCOV_INFO
20genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$1" --output-directory=lcov
21xdg-open lcov/index.html
22