summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 987ed2b..c10c035 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ BENCHFILE=$(BENCHDIR)/benchinput.md
ALLTESTS=alltests.md
NUMRUNS?=10
CMARK=$(BUILDDIR)/src/cmark
+CMARK_FUZZ=$(BUILDDIR)/src/cmark-fuzz
PROG?=$(CMARK)
VERSION?=$(SPECVERSION)
RELEASE?=CommonMark-$(VERSION)
@@ -77,10 +78,17 @@ afl:
$(AFL_PATH)/afl-fuzz \
-i test/afl_test_cases \
-o test/afl_results \
- -x test/afl_dictionary \
+ -x test/fuzzing_dictionary \
-t 100 \
$(CMARK) $(CMARK_OPTS)
+libFuzzer:
+ @[ -n "$(LIB_FUZZER_PATH)" ] || { echo '$$LIB_FUZZER_PATH not set'; false; }
+ mkdir -p $(BUILDDIR)
+ cd $(BUILDDIR) && cmake -DCMAKE_BUILD_TYPE=Asan -DCMARK_LIB_FUZZER=ON -DCMAKE_LIB_FUZZER_PATH=$(LIB_FUZZER_PATH) ..
+ $(MAKE) -j2 -C $(BUILDDIR) cmark-fuzz
+ test/run-cmark-fuzz $(CMARK_FUZZ)
+
clang-check: all
${CLANG_CHECK} -p build -analyze src/*.c