From ab4e0a32ab33d43520ab2a04cc60606252404d05 Mon Sep 17 00:00:00 2001 From: Benjamin Nortier Date: Wed, 8 Dec 2010 18:12:46 +0000 Subject: Add rebar code path to common test code path --- src/rebar_ct.erl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/rebar_ct.erl') 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, -- cgit v1.1