diff options
| author | Fred Hebert <mononcqc@ferd.ca> | 2015-03-04 08:40:11 -0500 | 
|---|---|---|
| committer | Fred Hebert <mononcqc@ferd.ca> | 2015-03-04 08:40:11 -0500 | 
| commit | 768cfccda5137458b79f1716d0dfcd75e140435e (patch) | |
| tree | 771accac88558da03b364a5dd948a6dfb286a640 | |
| parent | cdca70dfecec5295a8e7328755a4af2f670237df (diff) | |
| parent | 90bff8f8d4f4387765c63bb67b80bd8b031c8c83 (diff) | |
Merge pull request #213 from talentdeficit/eunit_fix
preserve state when compiling directories with a `rebar.config`
| -rw-r--r-- | src/rebar_prv_eunit.erl | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl index d841f26..e554f98 100644 --- a/src/rebar_prv_eunit.erl +++ b/src/rebar_prv_eunit.erl @@ -127,28 +127,27 @@ set_verbose(Opts) ->      end.  compile_tests(State, TestApps) -> -    State1 = replace_src_dirs(State),      F = fun(AppInfo) ->          AppDir = rebar_app_info:dir(AppInfo),          S = case rebar_app_info:state(AppInfo) of              undefined ->                  C = rebar_config:consult(AppDir), -                rebar_state:new(State1, C, AppDir); +                rebar_state:new(State, C, AppDir);              AppState ->                  AppState          end, -        ok = rebar_erlc_compiler:compile(S, +        ok = rebar_erlc_compiler:compile(replace_src_dirs(S),                                           ec_cnv:to_list(rebar_app_info:dir(AppInfo)),                                           ec_cnv:to_list(rebar_app_info:out_dir(AppInfo)))      end,      lists:foreach(F, TestApps), -    compile_bare_tests(State1, TestApps). +    compile_bare_tests(State, TestApps).  compile_bare_tests(State, TestApps) ->      F = fun(App) -> rebar_app_info:dir(App) == rebar_dir:get_cwd() end,      case lists:filter(F, TestApps) of          %% compile just the `test` directory of the base dir -        [] -> rebar_erlc_compiler:compile(State, +        [] -> rebar_erlc_compiler:compile(replace_src_dirs(State),                                            rebar_dir:get_cwd(),                                            rebar_dir:base_dir(State));          %% already compiled `./test` so do nothing | 
