summaryrefslogtreecommitdiff
path: root/inttest
diff options
context:
space:
mode:
authorTim Watson <watson.timothy@gmail.com>2011-08-01 08:12:36 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-08-18 15:35:30 +0200
commit5bb536f83985dfb840cac7c59c5473af1cae12bb (patch)
tree6b0fec6be69f4f41d28b308730001c0092fdb342 /inttest
parentda31f90d1dc1674c5ad1e084fce897e5fdd5f07b (diff)
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.
Diffstat (limited to 'inttest')
-rw-r--r--inttest/t_custom_config/custom.config1
-rw-r--r--inttest/t_custom_config/custom_config.erl6
-rw-r--r--inttest/t_custom_config/t_custom_config_rt.erl31
3 files changed, 38 insertions, 0 deletions
diff --git a/inttest/t_custom_config/custom.config b/inttest/t_custom_config/custom.config
new file mode 100644
index 0000000..6e6cd92
--- /dev/null
+++ b/inttest/t_custom_config/custom.config
@@ -0,0 +1 @@
+{erl_opts, [warnings_as_errors]}.
diff --git a/inttest/t_custom_config/custom_config.erl b/inttest/t_custom_config/custom_config.erl
new file mode 100644
index 0000000..8656201
--- /dev/null
+++ b/inttest/t_custom_config/custom_config.erl
@@ -0,0 +1,6 @@
+-module(custom_config).
+
+-compile(export_all).
+
+test() ->
+ ok.
diff --git a/inttest/t_custom_config/t_custom_config_rt.erl b/inttest/t_custom_config/t_custom_config_rt.erl
new file mode 100644
index 0000000..8a4e2ab
--- /dev/null
+++ b/inttest/t_custom_config/t_custom_config_rt.erl
@@ -0,0 +1,31 @@
+-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]).