summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Nortier <bjnortier@gmail.com>2010-12-08 18:12:46 +0000
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2010-12-09 00:20:54 +0100
commitab4e0a32ab33d43520ab2a04cc60606252404d05 (patch)
tree289557298c7187339266103b78b17043f9a401cc /src
parent6e9cec31ef5bb59f1651007b4af43fa0a5ac9451 (diff)
Add rebar code path to common test code path
Diffstat (limited to 'src')
-rw-r--r--src/rebar_ct.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index fc87dd3..316998f 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -130,13 +130,22 @@ make_cmd(TestDir, Config) ->
Include = ""
end,
+ %% Add the code path of the rebar process to the code path. This
+ %% includes the dependencies in the code path. The directories
+ %% that are part of the root Erlang install are filtered out to
+ %% avoid duplication
+ R = code:root_dir(),
+ NonLibCodeDirs = [P || P <- code:get_path(), lists:prefix(R, P) == false],
+ CodeDirs = [io_lib:format("\"~s\"", [Dir]) ||
+ Dir <- [EbinDir|NonLibCodeDirs]],
+ CodePathString = string:join(CodeDirs, " "),
Cmd = ?FMT("erl " % should we expand ERL_PATH?
- " -noshell -pa \"~s\" ~s"
+ " -noshell -pa ~s ~s"
" -s ct_run script_start -s erlang halt"
" -name test@~s"
" -logdir \"~s\""
" -env TEST_DIR \"~s\"",
- [EbinDir,
+ [CodePathString,
Include,
net_adm:localhost(),
LogDir,