diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-02-19 09:21:15 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-02-19 09:21:15 -0500 |
commit | c3cdecf1252fe51caa7b9aeb0e1f77bd735c0131 (patch) | |
tree | adfcdacac38b87d7612a5757d0efd8d443d285cd /test | |
parent | f203bc3c4fa1727315b96ff0ec4501e35a64e30b (diff) | |
parent | 8874e414a80f7f29e3a8c8f00b3887399a7a6cbc (diff) |
Merge pull request #160 from tsloughter/sub_deps
use project sub-apps with deps in their rebar.config
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_deps_SUITE.erl | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/test/rebar_deps_SUITE.erl b/test/rebar_deps_SUITE.erl index 633e9a2..3228bc6 100644 --- a/test/rebar_deps_SUITE.erl +++ b/test/rebar_deps_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -all() -> [{group, git}, {group, pkg}]. +all() -> [sub_app_deps, {group, git}, {group, pkg}]. groups() -> [{all, [], [flat, pick_highest_left, pick_highest_right, @@ -29,6 +29,8 @@ init_per_group(_, Config) -> end_per_group(_, Config) -> Config. +init_per_testcase(sub_app_deps, Config) -> + rebar_test_utils:init_rebar_state(Config); init_per_testcase(Case, Config) -> {Deps, Warnings, Expect} = deps(Case), Expected = case Expect of @@ -191,6 +193,32 @@ circular1(Config) -> run(Config). circular2(Config) -> run(Config). circular_skip(Config) -> run(Config). +%% Test that the deps of project apps that have their own rebar.config +%% are included, but that top level rebar.config deps take precedence +sub_app_deps(Config) -> + AppDir = ?config(apps, Config), + Deps = expand_deps(git, [{"a", "1.0.0", []} + ,{"b", "1.0.0", []} + ,{"b", "2.0.0", []}]), + mock_git_resource:mock([{deps, flat_deps(Deps)}]), + + Name = rebar_test_utils:create_random_name("sub_app1_"), + Vsn = rebar_test_utils:create_random_vsn(), + + SubAppsDir = filename:join([AppDir, Name]), + SubDeps = top_level_deps(expand_deps(git, [{"a", "1.0.0", []} + ,{"b", "2.0.0", []}])), + rebar_test_utils:create_app(SubAppsDir, Name, Vsn, [kernel, stdlib]), + rebar_test_utils:create_config(SubAppsDir, [{deps, SubDeps}]), + + TopDeps = top_level_deps(expand_deps(git, [{"b", "1.0.0", []}])), + {ok, RebarConfig} = file:consult(rebar_test_utils:create_config(AppDir, [{deps, TopDeps}])), + + rebar_test_utils:run_and_check( + Config, RebarConfig, ["compile"], + {ok, [{app, Name}, {dep, "a"}, {dep, "b", "1.0.0"}]}). + + run(Config) -> {ok, RebarConfig} = file:consult(?config(rebarconfig, Config)), rebar_test_utils:run_and_check( |