cmark

My personal build of CMark ✏️

Commit
58ebff02fd350f1b73d62caf0c1e976b4576e2ab
Parent
71e14bb77b1bceca3cf6e48d4b074e74c046ed04
Author
John MacFarlane <jgm@berkeley.edu>
Date

Improved fuzztest.

Diffstat

1 file changed, 5 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified Makefile 7 5 2
diff --git a/Makefile b/Makefile
@@ -5,6 +5,7 @@ JSMODULES=$(wildcard js/lib/*.js)
 SPEC=spec.txt
 SITE=_site
 BUILDDIR=build
+FUZZCHARS=2000000  # for fuzztest
 PROG?=$(BUILDDIR)/src/cmark
 
 .PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check
@@ -71,8 +72,10 @@ operf: $(PROG)
 	operf $(PROG) <$(BENCHINP) >/dev/null
 
 fuzztest:
-	for i in `seq 1 10`; do \
-	  time cat /dev/urandom | head -c 500000 | iconv -f latin1 -t utf-8 | tee fuzz-$$i.txt | $(PROG) > /dev/null && rm fuzz-$$i.txt ; done
+	{ for i in `seq 1 10`; do \
+	  cat /dev/urandom | head -c $(FUZZCHARS) | iconv -f latin1 -t utf-8 | tee fuzz-$$i.txt | \
+		/usr/bin/env time -p $(PROG) >/dev/null && rm fuzz-$$i.txt ; \
+	done } 2>&1 | grep user
 
 update-site: spec.html
 	make -C $(SITE) update