aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/cover.mk
diff options
context:
space:
mode:
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