diff options
author | Eric B Merritt <[email protected]> | 2013-04-09 20:50:37 -0700 |
---|---|---|
committer | Eric B Merritt <[email protected]> | 2013-04-09 20:50:37 -0700 |
commit | c003f00bfc33df3c561ee773f760c6d03e77ec14 (patch) | |
tree | 2d1febcc52525606bfd027cfcfb1d9ca48bca095 | |
parent | 10eb471cda3609156e21af93e04522543fb674c0 (diff) | |
download | relx-c003f00bfc33df3c561ee773f760c6d03e77ec14.tar.gz relx-c003f00bfc33df3c561ee773f760c6d03e77ec14.tar.bz2 relx-c003f00bfc33df3c561ee773f760c6d03e77ec14.zip |
make sure that top level releases are also supported
Add matching test
-rw-r--r-- | src/rcl_prv_discover.erl | 3 | ||||
-rw-r--r-- | test/rclt_release_SUITE.erl | 31 |
2 files changed, 31 insertions, 3 deletions
diff --git a/src/rcl_prv_discover.erl b/src/rcl_prv_discover.erl index fa810a6..3627787 100644 --- a/src/rcl_prv_discover.erl +++ b/src/rcl_prv_discover.erl @@ -97,6 +97,7 @@ add_common_project_dirs(State) -> Apps = filename:join(Root, "apps"), Lib = filename:join(Root, "lib"), Deps = filename:join(Root, "deps"), + Ebin = filename:join(Root, "ebin"), lists:foldl(fun(Dir, LibDirs) -> case ec_file:exists(Dir) of true -> @@ -104,7 +105,7 @@ add_common_project_dirs(State) -> false -> LibDirs end - end, [], [Deps, Lib, Apps]) + end, [], [Deps, Lib, Apps, Ebin]) end. -spec add_system_lib_dir(rcl_state:t()) -> [file:name()]. diff --git a/test/rclt_release_SUITE.erl b/test/rclt_release_SUITE.erl index c774619..d4f9aac 100644 --- a/test/rclt_release_SUITE.erl +++ b/test/rclt_release_SUITE.erl @@ -33,7 +33,8 @@ make_goalless_release/1, make_depfree_release/1, make_invalid_config_release/1, - make_relup_release/1]). + make_relup_release/1, + make_one_app_top_level_release/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -61,7 +62,8 @@ all() -> [make_release, make_scriptless_release, make_overridden_release, make_implicit_config_release, make_rerun_overridden_release, overlay_release, make_goalless_release, make_depfree_release, - make_invalid_config_release, make_relup_release]. + make_invalid_config_release, make_relup_release, + make_one_app_top_level_release]. make_release(Config) -> LibDir1 = proplists:get_value(lib1, Config), @@ -564,6 +566,31 @@ make_relup_release(Config) -> ?assert(lists:member({goal_app_2, "0.0.3"}, AppSpecs)), ?assert(lists:member({lib_dep_1, "0.0.1", load}, AppSpecs)). + +make_one_app_top_level_release(Config) -> + LibDir1 = proplists:get_value(lib1, Config), + {ok, AppInfo} = create_app(LibDir1, "goal_app_1", "0.0.1", [stdlib,kernel], []), + AppDir = rcl_app_info:dir(AppInfo), + ConfigFile = filename:join([AppDir, "relcool.config"]), + write_config(ConfigFile, + [{release, {foo, "0.0.1"}, + [{goal_app_1, "0.0.1"}]}]), + + OutputDir = filename:join([AppDir, + create_random_name("relcool-output")]), + + {ok, Cwd} = file:get_cwd(), + ok = file:set_cwd(AppDir), + {ok, State} = relcool:do(undefined, undefined, [], [], 2, + OutputDir, ConfigFile), + ok = file:set_cwd(Cwd), + [{{foo, "0.0.1"}, Release}] = ec_dictionary:to_list(rcl_state:releases(State)), + AppSpecs = rcl_release:applications(Release), + ?assert(lists:keymember(stdlib, 1, AppSpecs)), + ?assert(lists:keymember(kernel, 1, AppSpecs)), + ?assert(lists:member({goal_app_1, "0.0.1"}, AppSpecs)). + + %%%=================================================================== %%% Helper Functions %%%=================================================================== |