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.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/8f05368b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/8f05368b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/8f05368b

Branch: refs/heads/import
Commit: 8f05368ba4749cf21c7393c04856b7f059ab5676
Parents: 988c9cd
Author: Tuncer Ayaz <[email protected]>
Authored: Mon Sep 30 18:57:07 2013 +0200
Committer: Tuncer Ayaz <[email protected]>
Committed: Tue Nov 26 20:33:56 2013 +0100

----------------------------------------------------------------------
 src/rebar_erlc_compiler.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/8f05368b/src/rebar_erlc_compiler.erl
----------------------------------------------------------------------
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'}] ++

Reply via email to