diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-01-23 10:53:01 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-01-23 10:53:01 -0500 |
commit | 98ae221265887e309d1a3b4bae7b640b4201da61 (patch) | |
tree | de408740a0f8814f3118009b6338fae6e34bda73 | |
parent | bca0d1f91d56404a13d9486351aa2dd1fcf0f201 (diff) | |
parent | 0533f9dddcd72b2e810d30be441934fee55eccf7 (diff) |
Merge pull request #111 from tsloughter/test_erl_opts
don't lose erl_opts when compiling for tests
-rw-r--r-- | src/rebar_prv_common_test.erl | 4 | ||||
-rw-r--r-- | src/rebar_prv_eunit.erl | 10 |
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 |