From bca4d4070311afb035a72f976edbe4d8023e1517 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 13 Nov 2015 10:30:13 -0600 Subject: include Sean Cribbs eunit formatter by default --- src/rebar.app.src | 3 ++- src/rebar_prv_eunit.erl | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src') 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) -> -- cgit v1.1 From 87d9edc537d2af620f64e453797040b5ec7d0aca Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 13 Nov 2015 13:01:24 -0600 Subject: add space before end so eyes don't bleed --- src/rebar_prv_eunit.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl index 0f9976b..1884f02 100644 --- a/src/rebar_prv_eunit.erl +++ b/src/rebar_prv_eunit.erl @@ -307,7 +307,7 @@ resolve_eunit_opts(State) -> EUnitOpts1 = case proplists:get_value(verbose, Opts, false) of true -> set_verbose(EUnitOpts); false -> EUnitOpts - end, + end, case proplists:get_value(eunit_formatters, Opts, true) of true -> custom_eunit_formatters(EUnitOpts1); false -> EUnitOpts1 -- cgit v1.1