summaryrefslogtreecommitdiff
path: root/test/rebar_compile_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-04-22 18:12:43 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-04-22 18:12:43 -0500
commit0537a0699d01e4ae61dd32db0d964224bf9a1f5e (patch)
tree7baa98fd379b9d6a7e892adbbd783f4b75117067 /test/rebar_compile_SUITE.erl
parentde77225b49ca1af2e4a90f02ef248a15f1e74081 (diff)
parent12bd412c22fcfaeb752727a6c0098140704078f0 (diff)
Merge pull request #354 from tsloughter/track_code_path
Track code path
Diffstat (limited to 'test/rebar_compile_SUITE.erl')
-rw-r--r--test/rebar_compile_SUITE.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index 2fdf36d..ee262a1 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -102,10 +102,11 @@ build_checkout_deps(Config) ->
Deps = [{list_to_atom(Name2), Vsn2, {git, "", ""}}],
{ok, RebarConfig} = file:consult(rebar_test_utils:create_config(AppDir, [{deps, Deps}])),
- rebar_test_utils:run_and_check(
+ {ok, State} = rebar_test_utils:run_and_check(
Config, RebarConfig, ["compile"],
{ok, [{app, Name1}, {checkout, Name2}]}
),
+ code:add_paths(rebar_state:code_paths(State, all_deps)),
ok = application:load(list_to_atom(Name2)),
Loaded = application:loaded_applications(),
{_, _, Vsn2} = lists:keyfind(list_to_atom(Name2), 1, Loaded).
@@ -307,10 +308,11 @@ deps_in_path(Config) ->
?assertEqual([], [Path || Path <- code:get_path(),
{match, _} <- [re:run(Path, PkgName)]]),
%% Build things
- rebar_test_utils:run_and_check(
+ {ok, State} = rebar_test_utils:run_and_check(
Config, RConf, ["compile"],
{ok, [{app, Name}, {dep, DepName}, {dep, PkgName}]}
),
+ code:add_paths(rebar_state:code_paths(State, all_deps)),
%% Find src name in there
?assertNotEqual([], [Path || Path <- code:get_path(),
{match, _} <- [re:run(Path, DepName)]]),
@@ -326,11 +328,12 @@ deps_in_path(Config) ->
?assertEqual([], [Path || Path <- code:get_path(),
{match, _} <- [re:run(Path, PkgName)]]),
%% Rebuild
- rebar_test_utils:run_and_check(
+ {ok, State1} = rebar_test_utils:run_and_check(
Config, RConf, ["compile"],
{ok, [{app, Name}, {dep, DepName}, {dep, PkgName}]}
),
%% Find src name in there
+ code:add_paths(rebar_state:code_paths(State1, all_deps)),
?assertNotEqual([], [Path || Path <- code:get_path(),
{match, _} <- [re:run(Path, DepName)]]),
%% find pkg name in there
@@ -373,11 +376,11 @@ checkout_priority(Config) ->
%% Rebuild and make sure the checkout apps are in path
code:set_path(StartPaths),
- rebar_test_utils:run_and_check(
+ {ok, State} = rebar_test_utils:run_and_check(
Config, RConf, ["compile"],
{ok, [{app, Name}, {checkout, DepName}, {checkout, PkgName}]}
),
-
+ code:add_paths(rebar_state:code_paths(State, all_deps)),
[DepPath] = [Path || Path <- code:get_path(),
{match, _} <- [re:run(Path, DepName)]],
[PkgPath] = [Path || Path <- code:get_path(),