File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7878endif
7979
8080define ct_suite_target
81- ct-$( 1 ) : test-build
82- $(verbose ) mkdir -p $(CT_LOGS_DIR )
83- $(gen_verbose_esc ) $(CT_RUN ) -sname ct_$(PROJECT ) -suite $(addsuffix _SUITE,$( 1 ) ) $ (CT_EXTRA ) $(CT_OPTS )
81+ ct-$1 : test-build
82+ $$ (verbose ) mkdir -p $ $(CT_LOGS_DIR )
83+ $$ (gen_verbose_esc ) $$ (CT_RUN ) -sname ct_$$ (PROJECT ) -suite $$ (addsuffix _SUITE,$1) $$ (CT_EXTRA ) $ $(CT_OPTS )
8484endef
8585
8686$(foreach test,$(CT_SUITES),$(eval $(call ct_suite_target,$(test))))
Original file line number Diff line number Diff line change @@ -150,6 +150,33 @@ endif
150150 $t test -f $(APP)/logs/ct_run.*/cow_http_hd.COVER.html
151151 $t ! test -e $(APP)/logs/ct_run.*/ranch_app.COVER.html
152152
153+ cover-ct-single-suite : init
154+
155+ $i "Bootstrap a new OTP application named $(APP)"
156+ $t mkdir $(APP)/
157+ $t cp ../erlang.mk $(APP)/
158+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
159+
160+ $i "Generate a Common Test suite"
161+ $t mkdir $(APP)/test
162+ $t printf "%s\n" \
163+ "-module($(APP)_SUITE)." \
164+ "-export([all/0, ok/1])." \
165+ "all() -> [ok]." \
166+ "ok(_) -> application:start($(APP))." > $(APP)/test/$(APP)_SUITE.erl
167+
168+ $i "Run Common Test against this specific test suite with code coverage enabled"
169+ $t $(MAKE) -C $(APP) ct-$(APP) COVER=1 $v
170+
171+ $i "Check that the generated files exist"
172+ $t test -f $(APP)/cover/ct.coverdata
173+ $t test -f $(APP)/test/ct.cover.spec
174+
175+ $i "Check that the generated files are removed on clean"
176+ $t $(MAKE) -C $(APP) clean $v
177+ $t test ! -e $(APP)/cover/ct.coverdata
178+ $t test ! -e $(APP)/test/ct.cover.spec
179+
153180cover-custom-dir : init
154181
155182 $i "Bootstrap a new OTP application named $(APP)"
You can’t perform that action at this time.
0 commit comments