summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-01-22 21:14:06 -0600
committerTristan Sloughter <t@crashfast.com>2015-01-23 09:39:04 -0600
commit0533f9dddcd72b2e810d30be441934fee55eccf7 (patch)
treede408740a0f8814f3118009b6338fae6e34bda73 /src
parentd1902404dc5ea3ec6031f1c4fe7ad392acac92ba (diff)
don't lose erl_opts when compiling for tests
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_common_test.erl4
-rw-r--r--src/rebar_prv_eunit.erl10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index 9e17f38..5de1618 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -295,8 +295,8 @@ add_test_dir(Opts, InDirs) ->
%% if no src_dirs are set we have to specify `src` or it won't
%% be built
case proplists:append_values(src_dirs, Opts) of
- [] -> [{src_dirs, ["src", "test"|InDirs]}];
- _ -> [{src_dirs, ["test"|InDirs]}]
+ [] -> [{src_dirs, ["src", "test" | InDirs]} | Opts];
+ _ -> [{src_dirs, ["test" | InDirs]} | Opts]
end.
first_files(State) ->
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index a434fad..13d00b9 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -111,9 +111,9 @@ default_test_dir(State) ->
test_state(State, TmpDir) ->
ErlOpts = rebar_state:get(State, eunit_compile_opts, []) ++
- rebar_utils:erl_opts(State),
+ rebar_utils:erl_opts(State),
ErlOpts1 = [{outdir, TmpDir}] ++
- add_test_dir(ErlOpts),
+ add_test_dir(ErlOpts),
TestOpts = safe_define_test_macro(ErlOpts1),
rebar_state:set(State, erl_opts, TestOpts).
@@ -121,9 +121,9 @@ add_test_dir(Opts) ->
%% if no src_dirs are set we have to specify `src` or it won't
%% be built
case proplists:append_values(src_dirs, Opts) of
- [] -> [{src_dirs, ["src", "test"]}];
- Srcs -> [{src_dirs, ["test"|Srcs]}]
- end ++ lists:keydelete(src_dirs, 1, Opts).
+ [] -> [{src_dirs, ["src", "test"]} | Opts];
+ _ -> [{src_dirs, ["test"]} | Opts]
+ end.
safe_define_test_macro(Opts) ->
%% defining a compile macro twice results in an exception so