chore(test): enable cover only when necessary
So that ad-hoc ./rebar3 eunit and ct can run faster
This commit is contained in:
parent
173a4d8fea
commit
5f064a8e42
10
Makefile
10
Makefile
|
@ -33,23 +33,23 @@ get-dashboard:
|
|||
|
||||
.PHONY: eunit
|
||||
eunit: $(REBAR)
|
||||
@$(REBAR) eunit -v -c
|
||||
@ENABLE_COVER_COMPILE=1 $(REBAR) eunit -v -c
|
||||
|
||||
.PHONY: proper
|
||||
proper: $(REBAR)
|
||||
@$(REBAR) as test proper -d test/props -c
|
||||
@ENABLE_COVER_COMPILE=1 $(REBAR) as test proper -d test/props -c
|
||||
|
||||
.PHONY: ct
|
||||
ct: $(REBAR)
|
||||
@$(REBAR) ct --name 'test@127.0.0.1' -c -v
|
||||
@ENABLE_COVER_COMPILE=1 $(REBAR) ct --name 'test@127.0.0.1' -c -v
|
||||
|
||||
.PHONY: cover
|
||||
cover: $(REBAR)
|
||||
@$(REBAR) cover
|
||||
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
||||
|
||||
.PHONY: coveralls
|
||||
coveralls: $(REBAR)
|
||||
@$(REBAR) as test coveralls send
|
||||
@ENABLE_COVER_COMPILE=1 $(REBAR) as test coveralls send
|
||||
|
||||
.PHONY: $(REL_PROFILES)
|
||||
$(REL_PROFILES:%=%): $(REBAR) get-dashboard
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
]
|
||||
}.
|
||||
|
||||
{cover_enabled, true}.
|
||||
{cover_opts, [verbose]}.
|
||||
{cover_export_enabled, true}.
|
||||
{cover_excl_mods, [emqx_exproto_pb, emqx_exhook_pb]}.
|
||||
|
|
|
@ -50,11 +50,19 @@ community_plugin_overrides() ->
|
|||
[{add, App, [ {erl_opts, [{i, "include"}]}]} || App <- relx_plugin_apps_extra()].
|
||||
|
||||
config() ->
|
||||
[ {plugins, plugins()}
|
||||
[ {cover_enabled, is_cover_enabled()}
|
||||
, {plugins, plugins()}
|
||||
, {profiles, profiles()}
|
||||
, {project_app_dirs, project_app_dirs()}
|
||||
].
|
||||
|
||||
is_cover_enabled() ->
|
||||
case os:getenv("ENABLE_COVER_COMPILE") of
|
||||
"1"-> true;
|
||||
"true" -> true;
|
||||
_ -> false
|
||||
end.
|
||||
|
||||
is_enterprise() ->
|
||||
filelib:is_regular("EMQX_ENTERPRISE").
|
||||
|
||||
|
|
Loading…
Reference in New Issue