aboutsummaryrefslogtreecommitdiffstats
path: root/test/rclt_discover_SUITE.erl
diff options
context:
space:
mode:
authorEric B Merritt <[email protected]>2013-04-09 16:40:29 -0700
committerEric B Merritt <[email protected]>2013-04-09 16:40:50 -0700
commit4e863bd88520be1a786026eeb861cb70d00e7b01 (patch)
tree5fd62ac16db0044a0f8bac4914e39be76ced2447 /test/rclt_discover_SUITE.erl
parent9cc71b80c4387579469042b93f3240a0fd7c41c2 (diff)
downloadrelx-4e863bd88520be1a786026eeb861cb70d00e7b01.tar.gz
relx-4e863bd88520be1a786026eeb861cb70d00e7b01.tar.bz2
relx-4e863bd88520be1a786026eeb861cb70d00e7b01.zip
fixes #29 - look for common sub dirs for discovery
With this change relcool looks for the common sub directories to add to the search. Those directories are now, relative to the project dir, `apps`, `lib`, `ebin`, and the release output dir. These automatic subdirs can be disabled by setting `disable_project_subdirs` to `true` in the config. The release output dir is also added to the discovery process. This can be disabled by setting `disable_discover_release_output` to true.
Diffstat (limited to 'test/rclt_discover_SUITE.erl')
-rw-r--r--test/rclt_discover_SUITE.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/rclt_discover_SUITE.erl b/test/rclt_discover_SUITE.erl
index 4b6cb2a..e3a2861 100644
--- a/test/rclt_discover_SUITE.erl
+++ b/test/rclt_discover_SUITE.erl
@@ -111,7 +111,7 @@ no_beam_case(Config) ->
write_app_file(AppDir, BadName, BadVsn),
State0 = proplists:get_value(state, Config),
{DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0),
- EbinDir = filename:join([LibDir2, BadName, "ebin"]),
+ EbinDir = filename:join([LibDir2, BadName, <<"ebin">>]),
?assertMatch({error, {_, [{no_beam_files, EbinDir}]}},
rcl_provider:do(DiscoverProvider, State1)).
@@ -135,14 +135,12 @@ bad_ebin_case(Config) ->
BadName = create_random_name("error_bad"),
BadVsn = create_random_vsn(),
AppDir = filename:join([LibDir2, BadName]),
- Filename = filename:join([AppDir, "ebin", BadName ++ ".app"]),
- io:format("BAD -> ~p~n", [Filename]),
+ Filename = filename:join([AppDir, <<"ebin">>, BadName ++ ".app"]),
ok = filelib:ensure_dir(Filename),
ok = ec_file:write_term(Filename, get_bad_app_metadata(BadName, BadVsn)),
write_beam_file(AppDir, BadName),
State0 = proplists:get_value(state, Config),
{DiscoverProvider, {ok, State1}} = rcl_provider:new(rcl_prv_discover, State0),
-
?assertMatch({error, {_, [{invalid_app_file, Filename}]}},
rcl_provider:do(DiscoverProvider, State1)).
@@ -154,7 +152,8 @@ create_app(Dir, Name, Vsn) ->
AppDir = filename:join([Dir, Name]),
write_app_file(AppDir, Name, Vsn),
write_beam_file(AppDir, Name),
- {ok, App} = rcl_app_info:new(erlang:list_to_atom(Name), Vsn, AppDir,
+ {ok, App} = rcl_app_info:new(erlang:list_to_atom(Name), Vsn,
+ erlang:iolist_to_binary(AppDir),
[kernel, stdlib], []),
App.