GNUMakefile: Add 'coverage' target (requires luacov and luacov-console)
authorMatthew Wild <mwild1@gmail.com>
Sat, 17 Mar 2018 09:31:57 +0000
changeset 8615 1f2fb8070c7c
parent 8614 937de0c39279
child 8616 dbb4788db8e3
GNUMakefile: Add 'coverage' target (requires luacov and luacov-console)
GNUmakefile
--- a/GNUmakefile	Fri Mar 16 22:31:12 2018 +0000
+++ b/GNUmakefile	Sat Mar 17 09:31:57 2018 +0000
@@ -19,7 +19,7 @@
 MKDIR=install -d
 MKDIR_PRIVATE=$(MKDIR) -m750
 
-.PHONY: all test clean install
+.PHONY: all test coverage clean install
 
 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
 	$(MAKE) -C util-src install
@@ -68,6 +68,13 @@
 test:
 	busted --lua=$(RUNWITH)
 
+coverage:
+	-rm -- luacov.*
+	busted --lua=$(RUNWITH) -c
+	luacov
+	luacov-console
+	luacov-console -s
+
 util/%.so:
 	$(MAKE) install -C util-src