summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2020-10-28 22:32:49 +0300
committerAndrey Orst <andreyorst@gmail.com>2020-10-28 22:32:49 +0300
commite164175811974e89588c174d8597f1971cb368bf (patch)
tree408853d19fb4dd8abc31ab1656bcebcf8f9b1c3a
parent74570a8734f5762f5a4f38360fa8f06c051c3dad (diff)
feature: add support for luacov-console coverage tool
-rw-r--r--.gitignore1
-rw-r--r--Makefile21
2 files changed, 15 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index d907c43..1648fb8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.lua
+luacov.*
diff --git a/Makefile b/Makefile
index f48a608..23b9347 100644
--- a/Makefile
+++ b/Makefile
@@ -17,16 +17,23 @@ test:
@fennel core_test.fnl
@fennel macros_test.fnl
-test-coverage:
- @sh coverage.sh
-
-coverage: | clean all luacov-stats
+luacov: | clean all luacov-stats
luacov
+luacov-console: | luacov
+ @mv core_test.lua core_test.lua.tmp
+ @mv macros_test.lua macros_test.lua.tmp
+ luacov-console .
+ @mv core_test.lua.tmp core_test.lua
+ @mv macros_test.lua.tmp macros_test.lua
+
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"
- @echo "make clean -- remove lua files"
+ @echo "make -- run tests and create lua library" >&2
+ @echo "make test -- run tests" >&2
+ @echo "make clean -- remove lua files" >&2
+ @echo "make luacov -- build coverage report (requires working tests)" >&2
+ @echo "make luacov-console -- build coverage report (requires working tests)" >&2
+ @echo "make help -- print this message and exit" >&2