aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2015-05-18 19:29:21 -0700
committerJordan Wilberding <[email protected]>2015-05-18 19:29:21 -0700
commit74fec3455ba6dbb7d9e369137c1b15ab10804993 (patch)
treefdbd528f26a32e366257bda78ef118fcc0c5bfa3 /test
parentfbd2317b3f26f7cbd96a0f944f7ef3a3702e1f67 (diff)
parentf958bc281ca93061a4aae0d6a339f7e3807216ad (diff)
downloadrelx-74fec3455ba6dbb7d9e369137c1b15ab10804993.tar.gz
relx-74fec3455ba6dbb7d9e369137c1b15ab10804993.tar.bz2
relx-74fec3455ba6dbb7d9e369137c1b15ab10804993.zip
Merge pull request #345 from tsloughter/master
fix add_providers config option for newest providers dep
Diffstat (limited to 'test')
-rw-r--r--test/rlx_release_SUITE.erl40
1 files changed, 39 insertions, 1 deletions
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index c4c782b..9b09ab9 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -24,6 +24,7 @@
end_per_suite/1,
init_per_testcase/2,
all/0,
+ add_providers/1,
make_release/1,
make_extend_release/1,
make_scriptless_release/1,
@@ -67,7 +68,7 @@ init_per_testcase(_, Config) ->
{state, State1} | Config].
all() ->
- [make_release, make_extend_release, make_scriptless_release,
+ [add_providers, make_release, make_extend_release, make_scriptless_release,
make_overridden_release, make_auto_skip_empty_app_release,
make_skip_app_release, make_exclude_app_release, make_app_type_none_release,
make_implicit_config_release, make_rerun_overridden_release,
@@ -76,6 +77,43 @@ all() ->
make_one_app_top_level_release, make_dev_mode_release,
make_config_script_release].
+add_providers(Config) ->
+ LibDir1 = proplists:get_value(lib1, Config),
+
+ [(fun({Name, Vsn}) ->
+ rlx_test_utils:create_app(LibDir1, Name, Vsn, [kernel, stdlib], [])
+ end)(App)
+ ||
+ App <-
+ [{rlx_test_utils:create_random_name("lib_app1_"), rlx_test_utils:create_random_vsn()}
+ || _ <- lists:seq(1, 100)]],
+
+ rlx_test_utils:create_app(LibDir1, "goal_app_1", "0.0.1", [stdlib,kernel,non_goal_1], []),
+ rlx_test_utils:create_app(LibDir1, "lib_dep_1", "0.0.1", [stdlib,kernel], []),
+ rlx_test_utils:create_app(LibDir1, "goal_app_2", "0.0.1", [stdlib,kernel,goal_app_1,non_goal_2], []),
+ rlx_test_utils:create_app(LibDir1, "non_goal_1", "0.0.1", [stdlib,kernel], [lib_dep_1]),
+ rlx_test_utils:create_app(LibDir1, "non_goal_2", "0.0.1", [stdlib,kernel], []),
+
+ ConfigFile = filename:join([LibDir1, "relx.config"]),
+ rlx_test_utils:write_config(ConfigFile,
+ [{release, {foo, "0.0.1"},
+ [goal_app_1,
+ goal_app_2]},
+ {add_providers, [rlx_prv_app_discover]}]),
+ OutputDir = filename:join([proplists:get_value(data_dir, Config),
+ rlx_test_utils:create_random_name("relx-output")]),
+ {ok, State} = relx:do(undefined, undefined, [], [LibDir1], 3,
+ OutputDir, ConfigFile),
+ [{{foo, "0.0.1"}, Release}] = ec_dictionary:to_list(rlx_state:realized_releases(State)),
+ AppSpecs = rlx_release:applications(Release),
+ ?assert(lists:keymember(stdlib, 1, AppSpecs)),
+ ?assert(lists:keymember(kernel, 1, AppSpecs)),
+ ?assert(lists:member({non_goal_1, "0.0.1"}, AppSpecs)),
+ ?assert(lists:member({non_goal_2, "0.0.1"}, AppSpecs)),
+ ?assert(lists:member({goal_app_1, "0.0.1"}, AppSpecs)),
+ ?assert(lists:member({goal_app_2, "0.0.1"}, AppSpecs)),
+ ?assert(lists:member({lib_dep_1, "0.0.1", load}, AppSpecs)).
+
make_release(Config) ->
LibDir1 = proplists:get_value(lib1, Config),