Browse Source

Merge pull request #152 from tuncer/test-erl_opts

Fix erl_opts use
pull/3/head
Jared Morrow 11 years ago
parent
commit
7e81b22218
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      src/rebar_erlc_compiler.erl
  2. +2
    -2
      src/rebar_lfe_compiler.erl

+ 3
- 3
src/rebar_erlc_compiler.erl View File

@ -157,7 +157,8 @@ test_compile(Config, Cmd, OutDir) ->
%% Compile erlang code to OutDir, using a tweaked config %% Compile erlang code to OutDir, using a tweaked config
%% with appropriate defines for eunit, and include all the test modules %% with appropriate defines for eunit, and include all the test modules
%% as well. %% 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}. {ok, SrcErls}.
@ -201,12 +202,11 @@ info_help(Description) ->
{yrl_first_files, []} {yrl_first_files, []}
]). ]).
test_compile_config(Config, Cmd) ->
test_compile_config(Config, ErlOpts, Cmd) ->
{Config1, TriqOpts} = triq_opts(Config), {Config1, TriqOpts} = triq_opts(Config),
{Config2, PropErOpts} = proper_opts(Config1), {Config2, PropErOpts} = proper_opts(Config1),
{Config3, EqcOpts} = eqc_opts(Config2), {Config3, EqcOpts} = eqc_opts(Config2),
ErlOpts = rebar_config:get_list(Config3, erl_opts, []),
OptsAtom = list_to_atom(Cmd ++ "_compile_opts"), OptsAtom = list_to_atom(Cmd ++ "_compile_opts"),
EunitOpts = rebar_config:get_list(Config3, OptsAtom, []), EunitOpts = rebar_config:get_list(Config3, OptsAtom, []),
Opts0 = [{d, 'TEST'}] ++ Opts0 = [{d, 'TEST'}] ++

+ 2
- 2
src/rebar_lfe_compiler.erl View File

@ -70,8 +70,8 @@ compile_lfe(Source, _Target, Config) ->
"~n", []), "~n", []),
?FAIL; ?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 case lfe_comp:file(Source, Opts) of
{ok, _Mod, Ws} -> {ok, _Mod, Ws} ->
rebar_base_compiler:ok_tuple(Config, Source, Ws); rebar_base_compiler:ok_tuple(Config, Source, Ws);

Loading…
Cancel
Save