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
|
.PHONY: eunit
|
||||||
eunit: $(REBAR)
|
eunit: $(REBAR)
|
||||||
@$(REBAR) eunit -v -c
|
@ENABLE_COVER_COMPILE=1 $(REBAR) eunit -v -c
|
||||||
|
|
||||||
.PHONY: proper
|
.PHONY: proper
|
||||||
proper: $(REBAR)
|
proper: $(REBAR)
|
||||||
@$(REBAR) as test proper -d test/props -c
|
@ENABLE_COVER_COMPILE=1 $(REBAR) as test proper -d test/props -c
|
||||||
|
|
||||||
.PHONY: ct
|
.PHONY: ct
|
||||||
ct: $(REBAR)
|
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
|
.PHONY: cover
|
||||||
cover: $(REBAR)
|
cover: $(REBAR)
|
||||||
@$(REBAR) cover
|
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
||||||
|
|
||||||
.PHONY: coveralls
|
.PHONY: coveralls
|
||||||
coveralls: $(REBAR)
|
coveralls: $(REBAR)
|
||||||
@$(REBAR) as test coveralls send
|
@ENABLE_COVER_COMPILE=1 $(REBAR) as test coveralls send
|
||||||
|
|
||||||
.PHONY: $(REL_PROFILES)
|
.PHONY: $(REL_PROFILES)
|
||||||
$(REL_PROFILES:%=%): $(REBAR) get-dashboard
|
$(REL_PROFILES:%=%): $(REBAR) get-dashboard
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
]
|
]
|
||||||
}.
|
}.
|
||||||
|
|
||||||
{cover_enabled, true}.
|
|
||||||
{cover_opts, [verbose]}.
|
{cover_opts, [verbose]}.
|
||||||
{cover_export_enabled, true}.
|
{cover_export_enabled, true}.
|
||||||
{cover_excl_mods, [emqx_exproto_pb, emqx_exhook_pb]}.
|
{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()].
|
[{add, App, [ {erl_opts, [{i, "include"}]}]} || App <- relx_plugin_apps_extra()].
|
||||||
|
|
||||||
config() ->
|
config() ->
|
||||||
[ {plugins, plugins()}
|
[ {cover_enabled, is_cover_enabled()}
|
||||||
|
, {plugins, plugins()}
|
||||||
, {profiles, profiles()}
|
, {profiles, profiles()}
|
||||||
, {project_app_dirs, project_app_dirs()}
|
, {project_app_dirs, project_app_dirs()}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
is_cover_enabled() ->
|
||||||
|
case os:getenv("ENABLE_COVER_COMPILE") of
|
||||||
|
"1"-> true;
|
||||||
|
"true" -> true;
|
||||||
|
_ -> false
|
||||||
|
end.
|
||||||
|
|
||||||
is_enterprise() ->
|
is_enterprise() ->
|
||||||
filelib:is_regular("EMQX_ENTERPRISE").
|
filelib:is_regular("EMQX_ENTERPRISE").
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue