diff options
Diffstat (limited to 'src/rebar_prv_eunit.erl')
-rw-r--r-- | src/rebar_prv_eunit.erl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl index 371d205..3e57fb0 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 eunit 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 eunit provider posthooks + rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State1), + {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". - |