diff --git a/apps/rebar/src/rebar_prv_common_test.erl b/apps/rebar/src/rebar_prv_common_test.erl index a2542cf20..f71ca1ddc 100644 --- a/apps/rebar/src/rebar_prv_common_test.erl +++ b/apps/rebar/src/rebar_prv_common_test.erl @@ -273,15 +273,22 @@ add_hooks(Opts, State) -> true -> [cth_fail_fast]; false -> [] end, + % cth_readable_failonly hides all ct:pal for successful tests. + % When user asks for verbose operation, show these logs + {RawOpts, _} = rebar_state:command_parsed_args(State), + FailOnlyHook = case proplists:get_value(verbose, RawOpts, false) of + true -> []; + false -> [cth_readable_failonly] + end, case {readable(State), lists:keyfind(ct_hooks, 1, Opts)} of {false, _} -> Opts; {Other, false} -> - [{ct_hooks, [cth_readable_failonly, readable_shell_type(Other), + [{ct_hooks, FailOnlyHook ++ [readable_shell_type(Other), cth_retry] ++ FailFast ++ cth_log_redirect()} | Opts]; {Other, {ct_hooks, Hooks}} -> %% Make sure hooks are there once only and add wanted hooks that are not defined yet - ReadableHooks = [cth_readable_failonly, readable_shell_type(Other), + ReadableHooks = FailOnlyHook ++ [readable_shell_type(Other), cth_retry] ++ FailFast, NewHooks = Hooks ++ [ReadableHook || ReadableHook <- ReadableHooks,