Another nice diagnostic from the cmark Makefile is make fuzztest, which runs the program against ten randomly generated 200k strings of UTF-8 characters.
cmark is nice and even:
~/src/cmark % make fuzztest PROG=./cmark
{ for i in `seq 1 10`; do \
cat /dev/urandom | head -c 2000000 | iconv -f latin1 -t utf-8 | tee fuzz-$i.txt | \
/usr/bin/env time -p ./cmark >/dev/null && rm fuzz-$i.txt ; \
done } 2>&1 | grep 'user\|abnormally'
user 0.04
user 0.05
user 0.05
user 0.05
user 0.04
user 0.05
user 0.04
user 0.05
user 0.05
user 0.05
md2html doesn’t do so well on this:
~/src/cmark % make fuzztest PROG=md2html
{ for i in `seq 1 10`; do \
cat /dev/urandom | head -c 2000000 | iconv -f latin1 -t utf-8 | tee fuzz-$i.txt | \
/usr/bin/env time -p md2html >/dev/null && rm fuzz-$i.txt ; \
done } 2>&1 | grep 'user\|abnormally'
Command terminated abnormally.
user 20.88
user 0.15
user 0.17
user 0.31
Command terminated abnormally.
user 21.04
Command terminated abnormally.
user 20.99
user 0.22
user 0.23
user 0.38
Command terminated abnormally.
user 20.80