aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/cover.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-06 18:25:09 +0100
committerLoïc Hoguin <[email protected]>2018-12-06 18:25:09 +0100
commit754bad09421c70034242f4370c633e177a869151 (patch)
tree5d8e4faed1d6f204cd65a537f8f7eb58bacd975e /plugins/cover.mk
parent44fe1e993f16c98ed41c01e4511c0367e14e9637 (diff)
downloaderlang.mk-754bad09421c70034242f4370c633e177a869151.tar.gz
erlang.mk-754bad09421c70034242f4370c633e177a869151.tar.bz2
erlang.mk-754bad09421c70034242f4370c633e177a869151.zip
Add cover support for PropEr and Triq
Diffstat (limited to 'plugins/cover.mk')
-rw-r--r--plugins/cover.mk25
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins/cover.mk b/plugins/cover.mk
index 416219c..6fd8829 100644
--- a/plugins/cover.mk
+++ b/plugins/cover.mk
@@ -5,7 +5,7 @@
COVER_REPORT_DIR ?= cover
COVER_DATA_DIR ?= $(COVER_REPORT_DIR)
-# Hook in coverage to ct
+# Code coverage for Common Test.
ifdef COVER
ifdef CT_RUN
@@ -22,6 +22,29 @@ endif
endif
endif
+# Code coverage for other tools.
+
+ifdef COVER
+define cover.erl
+ CoverSetup = fun() ->
+ case filelib:is_dir("ebin") of
+ false -> false;
+ true ->
+ case cover:compile_beam_directory("ebin") of
+ {error, _} -> halt(1);
+ _ -> true
+ end
+ end
+ end,
+ CoverExport = fun(Filename) -> cover:export(Filename) end,
+endef
+else
+define cover.erl
+ CoverSetup = fun() -> ok end,
+ CoverExport = fun(_) -> ok end,
+endef
+endif
+
# Core targets
ifdef COVER