Skip to content

Commit 71ce66c

Browse files
committed
fix script
1 parent 6699b50 commit 71ce66c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

afl-cov.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ test "$1" = "-h" -o -z "$1" && {
99
echo Example: $0 ../target/out \"tools/target @@\"
1010
exit 1
1111
}
12+
1213
test -d "$1" || { echo Error: not a directory: $1 ; exit 1 ; }
1314
test -e "$1"/queue || { echo Error: not an afl-fuzz -o out directory ; exit 1 ; }
15+
16+
HOMEPATH=`dirname $0`
1417
DST=`realpath "$1"`
18+
export PATH=$HOMEPATH:$PATH
19+
1520
afl-cov -v -d "$DST" --cover-corpus --coverage-cmd "$2" --code-dir . --overwrite
21+
1622
test -e "$1"/fuzzer_stats && {
1723
echo "runtime :" $(expr `grep last_update "$DST"/fuzzer_stats|awk '{print$3}'` - `grep start_time "$DST"/fuzzer_stats|awk '{print$3}'`) seconds
1824
egrep 'execs_done|paths_total|^unique_|stability' "$DST"/fuzzer_stats
19-
}
25+
LINES=
26+
test -e "$1"/cov/afl-cov.log && LINES=`grep -w lines "$1"/cov/afl-cov.log|tail -n 1|sed 's/.*(//'|sed 's/ .*//'`
27+
echo "coverage : $LINES"
28+
} | tee "$1"/stats.out
29+
2030
echo open "file://$DST/cov/web/index.html"

0 commit comments

Comments
 (0)