From 0638c85634f3f9f51f17f247a3376f72b2f4d2fa Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 6 Mar 2015 08:59:10 -0600 Subject: store base opts after initialization of providers --- test/rebar_profiles_SUITE.erl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/rebar_profiles_SUITE.erl b/test/rebar_profiles_SUITE.erl index 55ab3d7..a4f926e 100644 --- a/test/rebar_profiles_SUITE.erl +++ b/test/rebar_profiles_SUITE.erl @@ -167,8 +167,11 @@ test_profile_applied_at_completion(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), + RebarConfig = [{erl_opts, [{d, some_define}]}], + rebar_test_utils:create_config(AppDir, RebarConfig), + {ok, State} = rebar_test_utils:run_and_check(Config, - [], + RebarConfig, ["eunit"], return), @@ -183,7 +186,10 @@ test_profile_applied_before_compile(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - rebar_test_utils:run_and_check(Config, [], ["eunit"], {ok, [{app, Name}]}), + RebarConfig = [{erl_opts, [{d, some_define}]}], + rebar_test_utils:create_config(AppDir, RebarConfig), + + rebar_test_utils:run_and_check(Config, RebarConfig, ["eunit"], {ok, [{app, Name}]}), S = list_to_atom("not_a_real_src_" ++ Name), true = lists:member({d, 'TEST'}, proplists:get_value(options, S:module_info(compile), [])). @@ -195,7 +201,10 @@ test_profile_applied_before_eunit(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), - rebar_test_utils:run_and_check(Config, [], ["eunit"], {ok, [{app, Name}]}), + RebarConfig = [{erl_opts, [{d, some_define}]}], + rebar_test_utils:create_config(AppDir, RebarConfig), + + rebar_test_utils:run_and_check(Config, RebarConfig, ["eunit"], {ok, [{app, Name}]}), T = list_to_atom("not_a_real_src_" ++ Name ++ "_tests"), true = lists:member({d, 'TEST'}, proplists:get_value(options, T:module_info(compile), [])). @@ -207,8 +216,11 @@ test_profile_applied_to_apps(Config) -> Vsn = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), + RebarConfig = [{erl_opts, [{d, some_define}]}], + rebar_test_utils:create_config(AppDir, RebarConfig), + {ok, State} = rebar_test_utils:run_and_check(Config, - [], + RebarConfig, ["eunit"], return), -- cgit v1.1