summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar.app.src3
-rw-r--r--src/rebar_prv_eunit.erl17
2 files changed, 16 insertions, 4 deletions
diff --git a/src/rebar.app.src b/src/rebar.app.src
index 14c08c9..67973eb 100644
--- a/src/rebar.app.src
+++ b/src/rebar.app.src
@@ -27,7 +27,8 @@
certifi,
cth_readable,
relx,
- inets]},
+ inets,
+ eunit_formatters]},
{env, [
%% Default log level
{log_level, warn},
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index d5612e8..0f9976b 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -304,9 +304,20 @@ validate_module(_State, Module) ->
resolve_eunit_opts(State) ->
{Opts, _} = rebar_state:command_parsed_args(State),
EUnitOpts = rebar_state:get(State, eunit_opts, []),
- case proplists:get_value(verbose, Opts, false) of
- true -> set_verbose(EUnitOpts);
- false -> EUnitOpts
+ EUnitOpts1 = case proplists:get_value(verbose, Opts, false) of
+ true -> set_verbose(EUnitOpts);
+ false -> EUnitOpts
+ end,
+ case proplists:get_value(eunit_formatters, Opts, true) of
+ true -> custom_eunit_formatters(EUnitOpts1);
+ false -> EUnitOpts1
+ end.
+
+custom_eunit_formatters(Opts) ->
+ %% If `report` is already set then treat that like `eunit_formatters` is false
+ case lists:keymember(report, 1, Opts) of
+ true -> Opts;
+ false -> [no_tty, {report, {eunit_progress, [colored, profile]}} | Opts]
end.
set_verbose(Opts) ->