aboutsummaryrefslogtreecommitdiffstats
path: root/test/rclt_release_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2012-12-10 12:19:36 -0800
committerTristan Sloughter <[email protected]>2012-12-10 12:19:36 -0800
commit25483b93b6f179b29742451ac65d367ab3b7ca7e (patch)
treef1fe9d5c6ddcf6626c84b9121ce1d334d776556e /test/rclt_release_SUITE.erl
parent69e6bcb71b8ce15556621fc94874bce751b50c50 (diff)
parentc3e728afb67101480d0c7b52c51bc522f08fb08f (diff)
downloadrelx-25483b93b6f179b29742451ac65d367ab3b7ca7e.tar.gz
relx-25483b93b6f179b29742451ac65d367ab3b7ca7e.tar.bz2
relx-25483b93b6f179b29742451ac65d367ab3b7ca7e.zip
Merge pull request #16 from ericbmerritt/next
default relcool.config support
Diffstat (limited to 'test/rclt_release_SUITE.erl')
-rw-r--r--test/rclt_release_SUITE.erl45
1 files changed, 43 insertions, 2 deletions
diff --git a/test/rclt_release_SUITE.erl b/test/rclt_release_SUITE.erl
index c13672a..4ac44d9 100644
--- a/test/rclt_release_SUITE.erl
+++ b/test/rclt_release_SUITE.erl
@@ -25,7 +25,8 @@
init_per_testcase/2,
all/0,
make_release/1,
- make_overridden_release/1]).
+ make_overridden_release/1,
+ make_implicit_config_release/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
@@ -49,7 +50,7 @@ init_per_testcase(_, Config) ->
{state, State} | Config].
all() ->
- [make_release, make_overridden_release].
+ [make_release, make_overridden_release, make_implicit_config_release].
make_release(Config) ->
LibDir1 = proplists:get_value(lib1, Config),
@@ -136,6 +137,46 @@ make_overridden_release(Config) ->
OverrideApp ++ "-" ++ OverrideVsn])),
?assertMatch(OverrideAppDir, Real).
+make_implicit_config_release(Config) ->
+ LibDir1 = proplists:get_value(lib1, Config),
+ FooRoot = filename:join([LibDir1, "foodir1", "foodir2"]),
+ filelib:ensure_dir(filename:join([FooRoot, "tmp"])),
+ [(fun({Name, Vsn}) ->
+ create_app(LibDir1, Name, Vsn, [kernel, stdlib], [])
+ end)(App)
+ ||
+ App <-
+ [{create_random_name("lib_app1_"), create_random_vsn()}
+ || _ <- lists:seq(1, 100)]],
+
+ create_app(LibDir1, "goal_app_1", "0.0.1", [stdlib,kernel,non_goal_1], []),
+ create_app(LibDir1, "lib_dep_1", "0.0.1", [stdlib,kernel], []),
+ create_app(LibDir1, "goal_app_2", "0.0.1", [stdlib,kernel,goal_app_1,non_goal_2], []),
+ create_app(LibDir1, "non_goal_1", "0.0.1", [stdlib,kernel], [lib_dep_1]),
+ create_app(LibDir1, "non_goal_2", "0.0.1", [stdlib,kernel], []),
+
+ ConfigFile = filename:join([LibDir1, "relcool.config"]),
+ write_config(ConfigFile,
+ [{release, {foo, "0.0.1"},
+ [goal_app_1,
+ goal_app_2]}]),
+ OutputDir = filename:join([proplists:get_value(data_dir, Config),
+ create_random_name("relcool-output")]),
+ ok = file:set_cwd(FooRoot),
+ {ok, FooRoot} = file:get_cwd(),
+ {ok, State} = relcool:do(undefined, undefined, [], [LibDir1], 2,
+ OutputDir, []),
+ [{{foo, "0.0.1"}, Release}] = ec_dictionary:to_list(rcl_state:releases(State)),
+ ?assert(ec_file:exists(OutputDir)),
+
+ AppSpecs = rcl_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)).
%%%===================================================================