aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2022-11-10 12:36:40 +0100
committerLoïc Hoguin <[email protected]>2022-11-10 12:36:40 +0100
commit6423c1c0570336c85540d8db1126831d319251bd (patch)
tree670fdc709125552ebc726aceda717a831b03b8b4 /test
parent94718f7715a05087d966a0ca4b32527892ac6cfc (diff)
downloaderlang.mk-6423c1c0570336c85540d8db1126831d319251bd.tar.gz
erlang.mk-6423c1c0570336c85540d8db1126831d319251bd.tar.bz2
erlang.mk-6423c1c0570336c85540d8db1126831d319251bd.zip
Fix code coverage for ct-* targets
Thanks to David Ansari for the report.
Diffstat (limited to 'test')
-rw-r--r--test/plugin_cover.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/plugin_cover.mk b/test/plugin_cover.mk
index a1d7e51..91b1b2c 100644
--- a/test/plugin_cover.mk
+++ b/test/plugin_cover.mk
@@ -150,6 +150,33 @@ endif
$t test -f $(APP)/logs/ct_run.*/cow_http_hd.COVER.html
$t ! test -e $(APP)/logs/ct_run.*/ranch_app.COVER.html
+cover-ct-single-suite: init
+
+ $i "Bootstrap a new OTP application named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
+
+ $i "Generate a Common Test suite"
+ $t mkdir $(APP)/test
+ $t printf "%s\n" \
+ "-module($(APP)_SUITE)." \
+ "-export([all/0, ok/1])." \
+ "all() -> [ok]." \
+ "ok(_) -> application:start($(APP))." > $(APP)/test/$(APP)_SUITE.erl
+
+ $i "Run Common Test against this specific test suite with code coverage enabled"
+ $t $(MAKE) -C $(APP) ct-$(APP) COVER=1 $v
+
+ $i "Check that the generated files exist"
+ $t test -f $(APP)/cover/ct.coverdata
+ $t test -f $(APP)/test/ct.cover.spec
+
+ $i "Check that the generated files are removed on clean"
+ $t $(MAKE) -C $(APP) clean $v
+ $t test ! -e $(APP)/cover/ct.coverdata
+ $t test ! -e $(APP)/test/ct.cover.spec
+
cover-custom-dir: init
$i "Bootstrap a new OTP application named $(APP)"