diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-11-13 10:30:13 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-11-13 13:02:29 -0600 |
commit | bca4d4070311afb035a72f976edbe4d8023e1517 (patch) | |
tree | 8edc7ae215bacc29fe36783b251721873474f34a /src | |
parent | 0b01c9fcf7443d36c6c3d67c74a70bad789ede5f (diff) |
include Sean Cribbs eunit formatter by default
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar.app.src | 3 | ||||
-rw-r--r-- | src/rebar_prv_eunit.erl | 17 |
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) -> |