forked from rockdaboot/wget2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fuzz/get_ossfuzz_corpora: Improve description text * fuzz/view-coverage.sh: Allow 1+ arguments
- Loading branch information
1 parent
f7fcbe0
commit 6f742a2
Showing
2 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
#!/bin/bash -eu | ||
# | ||
# (C)2017 Tim Ruehsen tim.ruehsen@gmx.de | ||
# | ||
# View the coverage report for one or more fuzzers. | ||
|
||
# 1. execute 'make fuzz-coverage' in the top directory | ||
# 2. execute './view-coverage.sh <fuzz target> | ||
# example: ./view-coverage.sh libwget_xml_parse_buffer_fuzzer | ||
# 2. execute './view-coverage.sh <fuzz target(s)> | ||
|
||
# Example with single fuzzer: | ||
# ./view-coverage.sh libwget_xml_parse_buffer_fuzzer | ||
|
||
# Example with two fuzzers: | ||
# ./view-coverage.sh libwget_xml_parse_buffer_fuzzer libwget_metalink_parse_fuzzer | ||
|
||
if test -z "$1"; then | ||
echo "Usage: $0 <fuzz target>" | ||
echo "Usage: $0 <fuzz target(s)>" | ||
echo "Example: $0 libwget_xml_parse_buffer_fuzzer" | ||
exit 1 | ||
fi | ||
|
||
fuzzer="./"$1 | ||
#fuzzer="./"$1 | ||
LCOV_INFO=coverage.info | ||
#make fuzz-coverage CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage" | ||
./coverage.sh $fuzzer | ||
#./coverage.sh $fuzzer | ||
#lcov --capture --initial --directory ../libwget/.libs --directory . --output-file $LCOV_INFO | ||
#lcov --capture --directory ../libwget/.libs --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 | ||
|
||
lcov --zerocounters --directory ../libwget/ | ||
lcov --capture --initial --directory ../libwget/.libs --directory . --output-file $LCOV_INFO | ||
make check TESTS="$*" CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage" | ||
lcov --capture --directory ../libwget/.libs --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 | ||
lcov --remove $LCOV_INFO '*/test_linking.c' '*/css_tokenizer.lex' '*/*.h' -o $LCOV_INFO | ||
genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$*" --output-directory=lcov | ||
|
||
xdg-open lcov/index.html |