summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2020-10-26 20:54:43 +0300
committerAndrey Orst <andreyorst@gmail.com>2020-10-26 20:57:06 +0300
commitcab42d9dbb162a6ca399d4d46dc20a5cbf4452ed (patch)
treec34aaf6b8e7160342c39bef7cc9ebf5f1b313050
parentd4da5f6c16f9fbbedb4f6b1fdcc0d617b3241219 (diff)
feature: add luacov target
-rw-r--r--Makefile19
1 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 2a462d7..c4c331b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,28 @@
-FNLSOURCES = core.fnl
+FNLSOURCES = core.fnl core_test.fnl macros_test.fnl
LUASOURCES = $(FNLSOURCES:.fnl=.lua)
-all: cljlib.lua
+all: $(LUASOURCES)
-.PHONY: all clean help test
+.PHONY: clean help test coverage all
-cljlib.lua: test $(LUASOURCES)
- mv core.lua cljlib.lua
+${LUASOURCES}: $(FNLSOURCES)
%.lua: %.fnl
- fennel --compile $^ > $@
+ fennel --compile $< > $@
clean:
- rm -f *.lua
+ rm -f *.lua luacov*
test:
@fennel core_test.fnl
@fennel macros_test.fnl
+coverage: | clean all luacov-stats
+ luacov
+
+luacov-stats: core_test.lua macros_test.lua
+ @lua -lluarocks.loader -lluacov $<
+
help:
@echo "make -- run tests and create lua library"
@echo "make test -- run tests"