From a3d4cc1259babf1541d5e278f11fc9ec9be75bb0 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 19 Apr 2015 12:54:32 -0500 Subject: track and cleanup code paths for different contexts --- src/rebar_prv_common_test.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/rebar_prv_common_test.erl') diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 1d5806b..a398144 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -38,6 +38,9 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> ?INFO("Running Common Test suites...", []), + + code:add_paths(rebar_state:code_paths(State, all_deps)), + %% Run ct provider prehooks Providers = rebar_state:providers(State), Cwd = rebar_dir:get_cwd(), @@ -47,11 +50,14 @@ do(State) -> {ok, State1} = Result -> %% Run ct provider posthooks rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State1), + rebar_utils:cleanup_code_path(rebar_state:code_paths(State1, default)), Result; ?PRV_ERROR(_) = Error -> + rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)), Error catch throw:{error, Reason} -> + rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)), ?PRV_ERROR(Reason) end. -- cgit v1.1