diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-08-23 14:23:58 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-08-23 14:23:58 -0500 |
commit | f2f63013fedbde4ea1de0ae09d767eb92eb1a5d2 (patch) | |
tree | 639cc2a71ebe37ed129c79e119ef12d6516b0af3 /test | |
parent | 657a1bf52e4de27d3d302de707fdd53fa3d0632e (diff) |
override 'deps' now automatically overrides '{deps,default}'
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_compile_SUITE.erl | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 1d5aab8..f726943 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -23,7 +23,9 @@ erl_first_files_test/1, mib_test/1, only_default_transitive_deps/1, - clean_all/1]). + clean_all/1, + override_deps/1, + profile_override_deps/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -52,7 +54,7 @@ all() -> dont_recompile_yrl_or_xrl, delete_beam_if_source_deleted, deps_in_path, checkout_priority, highest_version_of_pkg_dep, parse_transform_test, erl_first_files_test, mib_test, only_default_transitive_deps, - clean_all]. + clean_all, override_deps, profile_override_deps]. build_basic_app(Config) -> AppDir = ?config(apps, Config), @@ -591,3 +593,41 @@ clean_all(Config) -> Config, RConf, ["clean", "--all"], {ok, [{app, Name, invalid}, {app, DepName, invalid}, {app, PkgName, invalid}]} ). + +override_deps(Config) -> + mock_git_resource:mock([{deps, [{some_dep, "0.0.1"},{other_dep, "0.0.1"}]}]), + Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), + TopDeps = rebar_test_utils:top_level_deps(Deps), + + RebarConfig = [ + {deps, TopDeps}, + {overrides, [ + {override, some_dep, [ + {deps, []} + ]} + ]} + ], + rebar_test_utils:run_and_check( + Config, RebarConfig, ["compile"], + {ok, [{dep, "some_dep"},{dep_not_exist, "other_dep"}]} + ). + +profile_override_deps(Config) -> + mock_git_resource:mock([{deps, [{some_dep, "0.0.1"},{other_dep, "0.0.1"}]}]), + Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), + TopDeps = rebar_test_utils:top_level_deps(Deps), + + RebarConfig = [ + {deps, TopDeps}, + {profiles, [{a, + [{overrides, [ + {override, some_dep, [ + {deps, []} + ]} + ]} + ]} + ]}], + rebar_test_utils:run_and_check( + Config, RebarConfig, ["as", "a", "compile"], + {ok, [{dep, "some_dep"},{dep_not_exist, "other_dep"}]} + ). |