diff --git a/Makefile b/Makefile index 8a14bd2..cc4e57b 100644 --- a/Makefile +++ b/Makefile @@ -29,4 +29,15 @@ test: done | $(ZSH) -f tests/tap-colorizer.zsh; \ exit $$result +perf: + @result=0; \ + for test in highlighters/*; do \ + if [ -d $$test/test-data ]; then \ + echo "Running test $${test##*/}"; \ + $(ZSH) -f tests/test-perfs.zsh "$${test##*/}"; \ + : $$(( result |= $$? )); \ + fi \ + done; \ + exit $$result + .PHONY: all install test diff --git a/tests/README.md b/tests/README.md index 15aacd8..e82a64b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -32,3 +32,7 @@ performance test [`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the highlighting. Usage: zsh test-perfs.zsh + +All tests may be run with + + make perf