From 8f05368ba4749cf21c7393c04856b7f059ab5676 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 30 Sep 2013 18:57:07 +0200 Subject: erlc: properly reuse the right erl_opts in test_compile Avoid getting erl_opts twice in test_compile/3, and make sure the correctly filtered (platform_define, etc.) version is used. --- src/rebar_erlc_compiler.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 4157ba4..dbefa4a 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -157,7 +157,8 @@ test_compile(Config, Cmd, OutDir) -> %% Compile erlang code to OutDir, using a tweaked config %% with appropriate defines for eunit, and include all the test modules %% as well. - ok = doterl_compile(test_compile_config(Config, Cmd), OutDir, TestErls), + ok = doterl_compile(test_compile_config(Config, ErlOpts, Cmd), + OutDir, TestErls), {ok, SrcErls}. @@ -201,12 +202,11 @@ info_help(Description) -> {yrl_first_files, []} ]). -test_compile_config(Config, Cmd) -> +test_compile_config(Config, ErlOpts, Cmd) -> {Config1, TriqOpts} = triq_opts(Config), {Config2, PropErOpts} = proper_opts(Config1), {Config3, EqcOpts} = eqc_opts(Config2), - ErlOpts = rebar_config:get_list(Config3, erl_opts, []), OptsAtom = list_to_atom(Cmd ++ "_compile_opts"), EunitOpts = rebar_config:get_list(Config3, OptsAtom, []), Opts0 = [{d, 'TEST'}] ++ -- cgit v1.1 From 55d15394048148f9d9f26b0c509590e7fe0f4cfb Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 30 Sep 2013 19:05:23 +0200 Subject: lfe: use correctly filtered erl_opts --- src/rebar_lfe_compiler.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rebar_lfe_compiler.erl b/src/rebar_lfe_compiler.erl index 2a047d8..8488b0f 100644 --- a/src/rebar_lfe_compiler.erl +++ b/src/rebar_lfe_compiler.erl @@ -70,8 +70,8 @@ compile_lfe(Source, _Target, Config) -> "~n", []), ?FAIL; _ -> - Opts = [{i, "include"}, {outdir, "ebin"}, return] - ++ rebar_config:get_list(Config, erl_opts, []), + ErlOpts = rebar_utils:erl_opts(Config), + Opts = [{i, "include"}, {outdir, "ebin"}, return] ++ ErlOpts, case lfe_comp:file(Source, Opts) of {ok, _Mod, Ws} -> rebar_base_compiler:ok_tuple(Config, Source, Ws); -- cgit v1.1