Add fuzz testing corpus and build
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
|
||||
AFL_CC ?= afl-clang-fast
|
||||
AFL_CXX ?= afl-clang-fast++
|
||||
|
||||
.PHONY: all coverage coverage_report install uninstall
|
||||
|
||||
all: wl
|
||||
@@ -19,6 +22,19 @@ coverage_report:
|
||||
lcov --remove coverage.info '/usr/*' --output-file coverage_filtered.info
|
||||
genhtml coverage_filtered.info --output-directory coverage_html --title "WL Template Engine Coverage"
|
||||
|
||||
fuzz: fuzz.c wl.c wl.h
|
||||
$(AFL_CC) fuzz.c wl.c -o fuzz \
|
||||
-g -O3 -Wall \
|
||||
-fsanitize=address,undefined \
|
||||
-fno-omit-frame-pointer
|
||||
|
||||
bugs: fuzz
|
||||
AFL_SKIP_CPUFREQ=1 afl-fuzz \
|
||||
-i fuzz_input \
|
||||
-o /tmp/fuzz_output \
|
||||
-m none \
|
||||
./fuzz
|
||||
|
||||
install: wl
|
||||
sudo cp wl /usr/local/bin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user