diff options
-rw-r--r-- | rebar.config | 3 | ||||
-rw-r--r-- | rebar.lock | 1 | ||||
-rw-r--r-- | src/rebar.app.src | 3 | ||||
-rw-r--r-- | src/rebar_prv_eunit.erl | 17 |
4 files changed, 19 insertions, 5 deletions
diff --git a/rebar.config b/rebar.config index f19d81d..dcae904 100644 --- a/rebar.config +++ b/rebar.config @@ -9,7 +9,8 @@ {bbmustache, "1.0.4"}, {relx, "3.8.0"}, {cf, "0.1.3"}, - {cth_readable, "1.0.1"}]}. + {cth_readable, "1.0.1"}, + {eunit_formatters, "0.2.0"}]}. {escript_name, rebar3}. {escript_emu_args, "%%! +sbtu +A0\n"}. @@ -3,6 +3,7 @@ {<<"cf">>,{pkg,<<"cf">>,<<"0.1.3">>},0}, {<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.0.1">>},0}, {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"0.16.0">>},0}, + {<<"eunit_formatters">>,{pkg,<<"eunit_formatters">>,<<"0.2.0">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},0}, {<<"providers">>,{pkg,<<"providers">>,<<"1.5.0">>},0}, {<<"relx">>,{pkg,<<"relx">>,<<"3.8.0">>},0}, 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..1884f02 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) -> |