rebar/inttest/t_custom_config/t_custom_config_rt.erl
Tim Watson 5bb536f839 Respect the --config switch when given
Currently the --config switch does not work because when loading
a new rebar config the global setting is ignored for all paths.
This patch provides a check when loading new rebar config to see
whether or not the current config path matches the `base_dir` set in
global conf, which produces the expected behaviour.
2011-08-18 15:35:30 +02:00

31 lines
945 B
Erlang

-module(t_custom_config_rt).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
files() ->
[{copy, "custom.config", "custom.config"},
{create, "ebin/custom_config.app", app(custom_config, [custom_config])}].
run(Dir) ->
retest_log:log(debug, "Running in Dir: ~s~n", [Dir]),
Ref = retest:sh("rebar -C custom.config check-deps -v", [{async, true}]),
{ok, Captured} =
retest:sh_expect(Ref,
"DEBUG: Consult config file .*/custom.config.*",
[{capture, all, list}]),
retest_log:log(debug, "[CAPTURED]: ~s~n", [Captured]),
ok.
%%
%% Generate the contents of a simple .app file
%%
app(Name, Modules) ->
App = {application, Name,
[{description, atom_to_list(Name)},
{vsn, "1"},
{modules, Modules},
{registered, []},
{applications, [kernel, stdlib]}]},
io_lib:format("~p.\n", [App]).