summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSiri Hansen <siri@erlang.org>2016-12-13 12:51:01 +0100
committerSiri Hansen <siri@erlang.org>2016-12-13 12:51:01 +0100
commita18340c6eed6e62237c4ec63f15daacfe86dc86c (patch)
tree3f9bf6f204ea1f03da63e92a0f6eaa7e63791d2f /src
parente427a835301c41a1403cf6b9e6c363ceae3e781c (diff)
Allow using relative path to suite in project root
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_common_test.erl15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index cb33492..9db8106 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -529,26 +529,13 @@ translate_paths(_State, _Type, [], Acc) -> lists:reverse(Acc);
translate_paths(State, Type, [{Type, Val}|Rest], Acc) when is_integer(hd(Val)) ->
%% single file or dir
translate_paths(State, Type, [{Type, [Val]}|Rest], Acc);
-translate_paths(State, dir, [{dir, Dirs}|Rest], Acc) ->
- Apps = rebar_state:project_apps(State),
- New = {dir, lists:map(fun(Dir) -> translate(State, Apps, Dir) end, Dirs)},
- translate_paths(State, dir, Rest, [New|Acc]);
translate_paths(State, Type, [{Type, Files}|Rest], Acc) ->
- %% Type = suites | specs
Apps = rebar_state:project_apps(State),
- New = {Type, lists:map(fun(File) -> translate_file(State, Apps, File) end, Files)},
+ New = {Type, lists:map(fun(File) -> translate(State, Apps, File) end, Files)},
translate_paths(State, Type, Rest, [New|Acc]);
translate_paths(State, Type, [Test|Rest], Acc) ->
translate_paths(State, Type, Rest, [Test|Acc]).
-translate_file(State, Apps, File) ->
- Dirname = filename:dirname(File),
- Basename = filename:basename(File),
- case Dirname of
- "." -> File;
- _ -> filename:join([translate(State, Apps, Dirname), Basename])
- end.
-
translate(State, [App|Rest], Path) ->
case rebar_file_utils:path_from_ancestor(Path, rebar_app_info:dir(App)) of
{ok, P} -> filename:join([rebar_app_info:out_dir(App), P]);