Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/rebar/src/rebar_prv_common_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading