summaryrefslogtreecommitdiff
path: root/test/rebar_ct_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2017-09-01 12:21:25 -0700
committerTristan Sloughter <t@crashfast.com>2017-09-01 12:21:25 -0700
commit8e4f90fa08bb44e041b4225c49d5a75124adcb3c (patch)
treed4c2638c18ac1bf18d1bc6133009310d63db49d0 /test/rebar_ct_SUITE.erl
parentaf3d3b73c0676f061c7c26a628059f48213f135d (diff)
fix sys config merging
Diffstat (limited to 'test/rebar_ct_SUITE.erl')
-rw-r--r--test/rebar_ct_SUITE.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/rebar_ct_SUITE.erl b/test/rebar_ct_SUITE.erl
index 70cf60c..f009930 100644
--- a/test/rebar_ct_SUITE.erl
+++ b/test/rebar_ct_SUITE.erl
@@ -1132,12 +1132,19 @@ cmd_sys_config(Config) ->
CfgFile = filename:join([AppDir, "config", "cfg_sys.config"]),
ok = filelib:ensure_dir(CfgFile),
ok = file:write_file(CfgFile, cfg_sys_config_file(AppName)),
+
+ OtherCfgFile = filename:join([AppDir, "config", "other.config"]),
+ ok = filelib:ensure_dir(OtherCfgFile),
+ ok = file:write_file(OtherCfgFile, other_sys_config_file(AppName)),
+
RebarConfig = [{ct_opts, [{sys_config, CfgFile}]}],
{ok, State1} = rebar_test_utils:run_and_check(Config, RebarConfig, ["as", "test", "lock"], return),
{ok, _} = rebar_prv_common_test:prepare_tests(State1),
?assertEqual({ok, cfg_value}, application:get_env(AppName, key)),
+ ?assertEqual({ok, other_cfg_value}, application:get_env(AppName, other_key)),
+
Providers = rebar_state:providers(State1),
Namespace = rebar_state:namespace(State1),
CommandProvider = providers:get_provider(ct, Providers, Namespace),
@@ -1614,4 +1621,7 @@ cmd_sys_config_file(AppName) ->
io_lib:format("[{~ts, [{key, cmd_value}]}].", [AppName]).
cfg_sys_config_file(AppName) ->
- io_lib:format("[{~ts, [{key, cfg_value}]}].", [AppName]).
+ io_lib:format("[{~ts, [{key, cfg_value}]}, \"config/other\"].", [AppName]).
+
+other_sys_config_file(AppName) ->
+ io_lib:format("[{~ts, [{other_key, other_cfg_value}]}].", [AppName]).