From b06a6ecaddfc6fea16f3c24881fd41ac731ffa9e Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Wed, 20 May 2015 16:17:37 -0700 Subject: don't add `{extra_src_dirs, ["test"]}` to `test` profile adding it results in ct test suites being compiled before they're properly copied so changes made to suites between runs are not reflected if a run fails before test dirs are copied --- src/rebar_prv_common_test.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rebar_prv_common_test.erl') diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 2b97727..af77fa2 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -368,8 +368,11 @@ sub_dirs(Path) -> replace_src_dirs(State, Dirs) -> %% replace any `src_dirs` with the test dirs ErlOpts = rebar_state:get(State, erl_opts, []), - StrippedOpts = lists:keydelete(src_dirs, 1, ErlOpts), - rebar_state:set(State, erl_opts, [{src_dirs, Dirs}|StrippedOpts]). + StrippedOpts = filter_src_dirs(ErlOpts), + rebar_state:set(State, erl_opts, [{extra_src_dirs, Dirs}|StrippedOpts]). + +filter_src_dirs(ErlOpts) -> + lists:filter(fun({src_dirs, _}) -> false; ({extra_src_dirs, _}) -> false; (_) -> true end, ErlOpts). test_dirs(State, Opts) -> BareTest = filename:join([rebar_state:dir(State), "test"]), -- cgit v1.1