From 8cf6e4fb5bf1c2e6ffa2ead1ce8d72459046bf5d Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Wed, 8 Jul 2015 14:47:04 -0700 Subject: [PATCH] [feat] Added 'watch' to list of Makefile targets 'Watch' depends upon the inotify toolkit; it will automagically run the test suite locally every time you press "save". --- Makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c87e84f --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +.PHONY: test + +# docs: $(patsubst %.md,%.html,$(wildcard *.md)) + +SOURCES= chapter1/*.coffee chapter3/*.coffee chapter-lambda-1/*.coffee test/*.coffee + +%.js: src/%.coffee + node_modules/.bin/mocha coffee -c -o . $< + +%.html: %.md header.html footer.html + cat header.html > $@ + pandoc $< >> $@ + cat footer.html >> $@ + +node_modules: package.json + mkdir -p node_modules + npm install + +test: clean node_modules + @JUNIT_REPORT_PATH=test-reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha \ + --reporter mocha-jenkins-reporter --compilers coffee:coffee-script/register || true + +ltest: node_modules + @node_modules/.bin/mocha --compilers coffee:coffee-script/register + +watch: + while inotifywait $(SOURCES) ; do make test; done + +clean: + rm -f report.xml test-reports.xml