summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 16 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index eacc271..5ad87d0 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ VERSION?=$(SPECVERSION)
RELEASE?=CommonMark-$(VERSION)
INSTALL_PREFIX?=/usr/local
-.PHONY: all cmake_build spec leakcheck clean fuzztest dingus upload test update-site upload-site debug asan mingw archive bench astyle update-spec
+.PHONY: all cmake_build spec leakcheck clean fuzztest dingus upload test update-site upload-site debug ubsan asan mingw archive bench astyle update-spec afl
all: cmake_build man/man3/cmark.3
@@ -47,6 +47,12 @@ debug:
cmake .. -DCMAKE_BUILD_TYPE=Debug; \
make
+ubsan:
+ mkdir -p $(BUILDDIR); \
+ cd $(BUILDDIR); \
+ cmake .. -DCMAKE_BUILD_TYPE=Ubsan; \
+ make
+
asan:
mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
@@ -67,6 +73,8 @@ afl:
$(AFL_PATH)/afl-fuzz \
-i test/afl_test_cases \
-o test/afl_results \
+ -x test/afl_dictionary \
+ -t 100 \
-m none \
$(CMARK)
@@ -123,9 +131,14 @@ $(ALLTESTS): $(SPEC)
python3 test/spec_tests.py --spec $< --dump-tests | python3 -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print("\n".join([test["markdown"] for test in tests]))' > $@
leakcheck: $(ALLTESTS)
+ rc=0; \
for format in html man xml commonmark; do \
- cat $< | valgrind --leak-check=full --dsymutil=yes --error-exitcode=1 $(PROG) -t $$format >/dev/null; \
- done
+ for opts in "" "--smart" "--normalize"; do \
+ echo "cmark -t $$format $$opts" ; \
+ cat $< | valgrind -q --leak-check=full --dsymutil=yes --error-exitcode=1 $(PROG) -t $$format $$opts >/dev/null || rc=1; \
+ done; \
+ done; \
+ exit $$rc
fuzztest:
{ for i in `seq 1 10`; do \