Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain cth_log_redirect default in CT runs #2788

Merged
merged 1 commit into from
May 11, 2023
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
8 changes: 7 additions & 1 deletion apps/rebar/src/rebar_prv_common_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ add_hooks(Opts, State) ->
Opts;
{Other, false} ->
[{ct_hooks, [cth_readable_failonly, readable_shell_type(Other),
cth_retry] ++ FailFast} | Opts];
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),
Expand All @@ -300,6 +300,12 @@ is_defined(Key, [_ | Hs]) -> is_defined(Key, Hs).
readable_shell_type(true) -> cth_readable_shell;
readable_shell_type(compact) -> cth_readable_compact_shell.

cth_log_redirect() ->
case code:ensure_loaded(cth_log_redirect) of
{error, _} -> [];
{module, _} -> [cth_log_redirect]
end.

select_tests(_, _, _, {error, _} = Error) -> Error;
select_tests(State, ProjectApps, CmdOpts, CfgOpts) ->
%% set application env if sys_config argument is provided
Expand Down
Loading