mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Add rebar code path to common test code path
This commit is contained in:
parent
6e9cec31ef
commit
ab4e0a32ab
1 changed files with 11 additions and 2 deletions
|
@ -130,13 +130,22 @@ make_cmd(TestDir, Config) ->
|
||||||
Include = ""
|
Include = ""
|
||||||
end,
|
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?
|
Cmd = ?FMT("erl " % should we expand ERL_PATH?
|
||||||
" -noshell -pa \"~s\" ~s"
|
" -noshell -pa ~s ~s"
|
||||||
" -s ct_run script_start -s erlang halt"
|
" -s ct_run script_start -s erlang halt"
|
||||||
" -name test@~s"
|
" -name test@~s"
|
||||||
" -logdir \"~s\""
|
" -logdir \"~s\""
|
||||||
" -env TEST_DIR \"~s\"",
|
" -env TEST_DIR \"~s\"",
|
||||||
[EbinDir,
|
[CodePathString,
|
||||||
Include,
|
Include,
|
||||||
net_adm:localhost(),
|
net_adm:localhost(),
|
||||||
LogDir,
|
LogDir,
|
||||||
|
|
Loading…
Reference in a new issue