diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-20 14:35:59 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-20 14:35:59 +0100 |
| commit | a5b315a5873f1f71f7b41381e015013bc3072ae2 (patch) | |
| tree | 37323bd89099b21c674c80b8ad20b070f710836d /fuzz/Makefile | |
| parent | 6911290dbb577fb295e556da6fd7e4f5f7c81a8a (diff) | |
| download | vis-a5b315a5873f1f71f7b41381e015013bc3072ae2.tar.gz vis-a5b315a5873f1f71f7b41381e015013bc3072ae2.tar.xz | |
test/fuzz: add fuzzing driver for buffer
Diffstat (limited to 'fuzz/Makefile')
| -rw-r--r-- | fuzz/Makefile | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fuzz/Makefile b/fuzz/Makefile index 66037a2..bb05bd6 100644 --- a/fuzz/Makefile +++ b/fuzz/Makefile @@ -1,6 +1,6 @@ -include ../../config.mk -ALL = text-fuzzer +ALL = text-fuzzer buffer-fuzzer CC = afl-gcc CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4 @@ -10,6 +10,10 @@ text-fuzzer: text-fuzzer.c fuzzer.h ../../text.c ../../text-util.c ../../text-mo @echo Compiling $@ binary ${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@ +buffer-fuzzer: buffer-fuzzer.c fuzzer.h ../../buffer.c + @echo Compiling $@ binary + @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@ + debug: clean $(MAKE) CFLAGS_EXTRA='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}' @@ -18,6 +22,11 @@ afl-fuzz-text: text-fuzzer @afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \ afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" +afl-fuzz-buffer: buffer-fuzzer + @mkdir -p "results/$<" + @afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \ + afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" + clean: @echo cleaning @rm -f $(ALL) @@ -25,4 +34,4 @@ clean: distclean: clean @rm -rf results/ -.PHONY: clean distclean debug afl-fuzz-text +.PHONY: clean distclean debug afl-fuzz-text afl-fuzz-buffer |
