summaryrefslogtreecommitdiff
path: root/src/rebar_prv_eunit.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_eunit.erl')
-rw-r--r--src/rebar_prv_eunit.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 6872c99..1388a7b 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -37,9 +37,19 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
?INFO("Performing EUnit tests...", []),
+ %% Run ct provider prehooks
+ Providers = rebar_state:providers(State),
+ Cwd = rebar_dir:get_cwd(),
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
+
case prepare_tests(State) of
- {ok, Tests} -> do_tests(State, Tests);
- Error -> Error
+ {ok, Tests} ->
+ {ok, State1} = do_tests(State, Tests),
+ %% Run ct provider posthooks
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
+ {ok, State1};
+ Error ->
+ Error
end.
do_tests(State, Tests) ->
@@ -250,4 +260,3 @@ help(app) -> "List of application test suites to run";
help(cover) -> "Generate cover data";
help(suite) -> "List of test suites to run";
help(verbose) -> "Verbose output".
-