Преглед изворни кода

Merge pull request #2458 from TheGeorge/cth_readable_config

fix injection of cth_readable to allow for hook configuration
pull/2455/merge
Fred Hebert пре 4 година
committed by GitHub
родитељ
комит
575890f4c2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 измењених фајлова са 12 додато и 4 уклоњено
  1. +12
    -4
      src/rebar_prv_common_test.erl

+ 12
- 4
src/rebar_prv_common_test.erl Прегледај датотеку

@ -269,15 +269,23 @@ add_hooks(Opts, State) ->
[{ct_hooks, [cth_readable_failonly, readable_shell_type(Other),
cth_retry] ++ FailFast} | Opts];
{Other, {ct_hooks, Hooks}} ->
%% Make sure hooks are there once only.
%% Make sure hooks are there once only and add wanted hooks that are not defined yet
ReadableHooks = [cth_readable_failonly, readable_shell_type(Other),
cth_retry] ++ FailFast,
AllReadableHooks = [cth_readable_failonly, cth_retry, cth_fail_fast,
cth_readable_shell, cth_readable_compact_shell],
NewHooks = (Hooks -- AllReadableHooks) ++ ReadableHooks,
NewHooks = Hooks ++ [ReadableHook ||
ReadableHook <- ReadableHooks,
not is_defined(ReadableHook, Hooks)
],
lists:keyreplace(ct_hooks, 1, Opts, {ct_hooks, NewHooks})
end.
is_defined(_Key, []) -> false;
is_defined(Key, [Key | _Hs]) -> true;
is_defined(Key, [{Key, _Opts} | _Hs]) -> true;
is_defined(Key, [{Key, _Opts, _Prio} | _Hs]) -> true;
is_defined(Key, [_ | Hs]) -> is_defined(Key, Hs).
readable_shell_type(true) -> cth_readable_shell;
readable_shell_type(compact) -> cth_readable_compact_shell.

Loading…
Откажи
Сачувај