summaryrefslogtreecommitdiff
path: root/src/rebar_prv_common_test.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-04-05 10:23:43 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-04-05 10:23:43 -0400
commit3250faa75683bdbfc521c4e8c6772f45d6d2e863 (patch)
tree869b863aff8062d78042d27ef62f9236c3a4559f /src/rebar_prv_common_test.erl
parenta99344a47066dd26b02cf34e84c15aa2f6f4dbe5 (diff)
parent79e2d6006c989a241d4599d048ff39f094f9e886 (diff)
Merge pull request #320 from tsloughter/dep_plugins
install dep plugins & run provider hooks the same as shell hooks (Rereopen 316)
Diffstat (limited to 'src/rebar_prv_common_test.erl')
-rw-r--r--src/rebar_prv_common_test.erl16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index de77257..7602906 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -38,6 +38,11 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
?INFO("Running Common Test suites...", []),
+ %% Run ct provider prehooks
+ Providers = rebar_state:providers(State),
+ Cwd = rebar_dir:get_cwd(),
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
+
try
case setup_ct(State) of
{error, {no_tests_specified, Opts}} ->
@@ -46,9 +51,14 @@ do(State) ->
Opts ->
Opts1 = setup_logdir(State, Opts),
?DEBUG("common test opts: ~p", [Opts1]),
- run_test(State, Opts1)
+ {ok, State1} = run_test(State, Opts1),
+ %% Run ct provider posthooks
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State1),
+ {ok, State1}
end
- catch error:Reason -> ?PRV_ERROR(Reason)
+ catch
+ error:Reason ->
+ ?PRV_ERROR(Reason)
end.
-spec format_error(any()) -> iolist().
@@ -251,7 +261,7 @@ join(undefined, Suites) -> Suites;
join(Dir, Suites) when is_list(Dir), is_integer(hd(Dir)) ->
lists:map(fun(S) -> filename:join([Dir, S]) end, Suites);
%% multiple dirs or a bad dir argument, try to continue anyways
-join(_, Suites) -> Suites.
+join(_, Suites) -> Suites.
find_suite_dirs(Suites) ->
AllDirs = lists:map(fun(S) -> filename:dirname(filename:absname(S)) end, Suites),