summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-11-05 20:45:18 -0600
committerTristan Sloughter <t@crashfast.com>2014-11-05 20:45:18 -0600
commitf9b73b5d7ac3674b5830f5fc26cf6003ef652d66 (patch)
tree81ef3579b0b03af81b4c694792b039845101a6c9 /src
parente195dd9be9d14915fc3317715cd261ebd3703f02 (diff)
properly reset cwd after finding version of git resource
Diffstat (limited to 'src')
-rw-r--r--src/rebar_git_resource.erl2
-rw-r--r--src/rebar_prv_common_test.erl5
-rw-r--r--src/rebar_prv_test_deps.erl2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl
index 6b655de..1c4ece7 100644
--- a/src/rebar_git_resource.erl
+++ b/src/rebar_git_resource.erl
@@ -84,7 +84,7 @@ download(Dir, {git, Url, Rev}) ->
rebar_utils:sh(?FMT("git checkout -q ~s", [Rev]), [{cd, Dir}]).
make_vsn(Dir) ->
- Cwd = file:get_cwd(),
+ {ok, Cwd} = file:get_cwd(),
try
ok = file:set_cwd(Dir),
{Vsn, RawRef, RawCount} = collect_default_refcount(),
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index b439977..ce63192 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -34,6 +34,7 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()}.
do(State) ->
Opts = build_options(State),
+ expand_test_deps(filename:absname(rebar_state:get(State, test_deps_dir, ?DEFAULT_TEST_DEPS_DIR))),
ct:run_test(Opts),
{ok, State}.
@@ -41,6 +42,10 @@ do(State) ->
format_error(Reason, State) ->
{io_lib:format("~p", [Reason]), State}.
+expand_test_deps(Dir) ->
+ Apps = filelib:wildcard(filename:join([Dir, "*", "ebin"])),
+ ok = code:add_pathsa(Apps).
+
ct_opts(State) ->
DefaultTestDir = filename:join([rebar_state:dir(State), "test"]),
DefaultLogsDir = filename:join([rebar_state:dir(State), "logs"]),
diff --git a/src/rebar_prv_test_deps.erl b/src/rebar_prv_test_deps.erl
index a51f635..c9cd127 100644
--- a/src/rebar_prv_test_deps.erl
+++ b/src/rebar_prv_test_deps.erl
@@ -11,8 +11,6 @@
-define(PROVIDER, test_deps).
-define(DEPS, []).
--define(DEFAULT_TEST_DEPS_DIR, "_tdeps").
-
%% ===================================================================
%% Public API
%% ===================================================================