From ead4f4b77b23874d275863180cf4fd7ebebd38cd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 8 Nov 2014 16:19:06 -0800 Subject: Improved fuzztest. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fe781d6..afe939e 100644 --- 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 -- cgit v1.2.3 From 535afc08febf42fb984e7115bf7a947985690e41 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 8 Nov 2014 20:24:32 -0800 Subject: Spec: better system for designating definitions of terms. `[foo](@foo)` turns into an anchor with id `foo` that links to itself and has class `definition`. This allows us to remove the manual `` tags in `spec.txt`. A simple regex substitution in the Makefile handles the transformation. I believe this addresses some of the concerns in #141 by giving the definitions a prominent appearance. Note that we want definitions to link to themselves, to allow users to quickly generate a link to the relevant bit of the spec. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index afe939e..5f9cb34 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,10 @@ spec.md: $(SPEC) perl spec2md.pl < $< > $@ spec.html: spec.md template.html - pandoc --no-highlight --number-sections --template template.html -s --toc -S $< > $@ # | perl -pe 's/␣/ <\/span>/g' > $@ + pandoc --no-highlight --number-sections --template template.html -s --toc -S $< | \ + perl -pe 's/a href="@([^"]*)"/a id="\1" href="#\1" class="definition"/g' > $@ + + # | perl -pe 's/␣/ <\/span>/g' > $@ spec.pdf: spec.md template.tex specfilter.hs pandoc -s $< --template template.tex \ -- cgit v1.2.3 From faacf7065f0303a5b0d5c241e06bcfd8c827651c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 8 Nov 2014 20:52:36 -0800 Subject: Make spaces visible using CSS. Closes #49. I didn't want to actually insert the characters, since I want the code samples to be cut/pasteable. But this CSS trick seems to work. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5f9cb34..1b2d510 100644 --- a/Makefile +++ b/Makefile @@ -37,9 +37,10 @@ spec.md: $(SPEC) spec.html: spec.md template.html pandoc --no-highlight --number-sections --template template.html -s --toc -S $< | \ - perl -pe 's/a href="@([^"]*)"/a id="\1" href="#\1" class="definition"/g' > $@ + perl -pe 's/a href="@([^"]*)"/a id="\1" href="#\1" class="definition"/g' | \ + perl -pe 's/␣/ <\/span>/g' \ + > $@ - # | perl -pe 's/␣/ <\/span>/g' > $@ spec.pdf: spec.md template.tex specfilter.hs pandoc -s $< --template template.tex \ -- cgit v1.2.3