summaryrefslogtreecommitdiff
path: root/src/rebar_prv_common_test.erl
diff options
context:
space:
mode:
authoralisdair sullivan <alisdair.sullivan@askuity.com>2015-05-20 16:17:37 -0700
committeralisdair sullivan <alisdair.sullivan@askuity.com>2015-05-20 16:34:31 -0700
commitb06a6ecaddfc6fea16f3c24881fd41ac731ffa9e (patch)
treefa4a5faae3135521d0277e072a48fc7d6eeb7173 /src/rebar_prv_common_test.erl
parent41f31f608dff7837d80674600344d521982b10f4 (diff)
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
Diffstat (limited to 'src/rebar_prv_common_test.erl')
-rw-r--r--src/rebar_prv_common_test.erl7
1 files changed, 5 insertions, 2 deletions
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"]),