diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_eunit_SUITE.erl | 5 | ||||
-rw-r--r-- | test/rebar_pkg_SUITE.erl | 2 | ||||
-rw-r--r-- | test/rebar_profiles_SUITE.erl | 25 |
3 files changed, 28 insertions, 4 deletions
diff --git a/test/rebar_eunit_SUITE.erl b/test/rebar_eunit_SUITE.erl index 6fb325b..4805b3d 100644 --- a/test/rebar_eunit_SUITE.erl +++ b/test/rebar_eunit_SUITE.erl @@ -1,7 +1,8 @@ -module(rebar_eunit_SUITE). -export([all/0, groups/0]). --export([init_per_suite/1, init_per_group/2, end_per_group/2]). +-export([init_per_suite/1, end_per_suite/1]). +-export([init_per_group/2, end_per_group/2]). -export([basic_app_compiles/1, basic_app_files/1]). -export([basic_app_exports/1, basic_app_testset/1]). -export([basic_app_eunit_macro/1]). @@ -60,6 +61,8 @@ init_per_suite(Config) -> {ok, _} = zip:extract(filename:join([PrivDir, "multi_app.zip"]), [{cwd, PrivDir}]), Config. +end_per_suite(Config) -> Config. + init_per_group(basic_app, Config) -> GroupState = rebar_test_utils:init_rebar_state(Config, "basic_app_"), diff --git a/test/rebar_pkg_SUITE.erl b/test/rebar_pkg_SUITE.erl index 30cc0a8..32873c8 100644 --- a/test/rebar_pkg_SUITE.erl +++ b/test/rebar_pkg_SUITE.erl @@ -287,7 +287,7 @@ mock_config(Name, Config) -> unmock_config(Config) -> meck:unload(), - ets:delete(?config(mock_table, Config)). + catch ets:delete(?config(mock_table, Config)). copy_to_cache({Pkg,Vsn}, Config) -> Name = <<Pkg/binary, "-", Vsn/binary, ".tar">>, diff --git a/test/rebar_profiles_SUITE.erl b/test/rebar_profiles_SUITE.erl index ed492a9..9ffaf98 100644 --- a/test/rebar_profiles_SUITE.erl +++ b/test/rebar_profiles_SUITE.erl @@ -25,7 +25,8 @@ test_profile_erl_opts_order_2/1, test_profile_erl_opts_order_3/1, test_profile_erl_opts_order_4/1, - test_profile_erl_opts_order_5/1]). + test_profile_erl_opts_order_5/1, + first_files_exception/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -46,7 +47,8 @@ all() -> test_profile_erl_opts_order_2, test_profile_erl_opts_order_3, test_profile_erl_opts_order_4, - test_profile_erl_opts_order_5]. + test_profile_erl_opts_order_5, + first_files_exception]. init_per_suite(Config) -> application:start(meck), @@ -468,6 +470,25 @@ test_profile_erl_opts_order_5(Config) -> Opt = last_erl_opt(Opts, [warn_export_all, nowarn_export_all], undefined), warn_export_all = Opt. +first_files_exception(_Config) -> + RebarConfig = [{erl_first_files, ["c","a","b"]}, + {mib_first_files, ["c","a","b"]}, + {other, ["c","a","b"]}, + {profiles, + [{profile2, [{erl_first_files, ["a","e"]}, + {mib_first_files, ["a","e"]}, + {other, ["a","e"]} + ]}]}], + State = rebar_state:new(RebarConfig), + State1 = rebar_state:apply_profiles(State, [profile2]), + + %% Combine lists + ?assertEqual(["a","b","c","e"], rebar_state:get(State1, other)), + %% there is no specific reason not to dedupe "a" here aside from "this is how it is" + ?assertEqual(["c","a","b","a","e"], rebar_state:get(State1, erl_first_files)), + ?assertEqual(["c","a","b","a","e"], rebar_state:get(State1, mib_first_files)), + ok. + get_compiled_profile_erl_opts(Profiles, Config) -> AppDir = ?config(apps, Config), PStrs = [atom_to_list(P) || P <- Profiles], |