diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-03-23 15:34:01 -0700 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-03-23 15:34:01 -0700 |
commit | 75549d3a9180bfe83649cc7bbaffc93f932f12fc (patch) | |
tree | 7595ff387956e4ebcb67f963cd9b91dabf1bed8c /test/rebar_release_SUITE.erl | |
parent | cafd62e10185e2fc05490c387484dfdb2b615803 (diff) | |
parent | 48aa18be4fa202e803eb55418c6c53d9afb17685 (diff) |
Merge pull request #290 from ferd/fancy-profile-merge-fun
Fancy profile merge fun
Diffstat (limited to 'test/rebar_release_SUITE.erl')
-rw-r--r-- | test/rebar_release_SUITE.erl | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/test/rebar_release_SUITE.erl b/test/rebar_release_SUITE.erl index 92219a5..3809106 100644 --- a/test/rebar_release_SUITE.erl +++ b/test/rebar_release_SUITE.erl @@ -3,7 +3,10 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -all() -> [release, tar]. +all() -> [release, + dev_mode_release, + profile_dev_mode_override_release, + tar]. init_per_testcase(Case, Config0) -> Config = rebar_test_utils:init_rebar_state(Config0), @@ -33,9 +36,46 @@ release(Config) -> rebar_test_utils:run_and_check( Config, RebarConfig, ["release"], - {ok, [{release, list_to_atom(Name), Vsn}]} + {ok, [{release, list_to_atom(Name), Vsn, false}]} ). +dev_mode_release(Config) -> + AppDir = ?config(apps, Config), + Name = ?config(name, Config), + Vsn = "1.0.0", + {ok, RebarConfig} = + file:consult(rebar_test_utils:create_config(AppDir, + [{relx, [{release, {list_to_atom(Name), Vsn}, + [list_to_atom(Name)]}, + {lib_dirs, [AppDir]}, + {dev_mode, true}]}])), + rebar_test_utils:run_and_check( + Config, RebarConfig, + ["release"], + {ok, [{release, list_to_atom(Name), Vsn, true}]} + ). + + +profile_dev_mode_override_release(Config) -> + AppDir = ?config(apps, Config), + Name = ?config(name, Config), + Vsn = "1.0.0", + {ok, RebarConfig} = + file:consult(rebar_test_utils:create_config(AppDir, + [{relx, [{release, {list_to_atom(Name), Vsn}, + [list_to_atom(Name)]}, + {lib_dirs, [AppDir]}, + {dev_mode, true}]}, + {profiles, + [{ct, + [{relx, [{dev_mode, false}]}]}]}])), + rebar_test_utils:run_and_check( + Config, RebarConfig, + ["as", "ct", "release"], + {ok, [{release, list_to_atom(Name), Vsn, false}]} + ). + + tar(Config) -> AppDir = ?config(apps, Config), Name = ?config(name, Config), @@ -48,5 +88,5 @@ tar(Config) -> rebar_test_utils:run_and_check( Config, RebarConfig, ["tar"], - {ok, [{release, list_to_atom(Name), Vsn}, {tar, Name, Vsn}]} + {ok, [{release, list_to_atom(Name), Vsn, false}, {tar, Name, Vsn}]} ). |