mirror of
https://github.com/correl/rebar.git
synced 2024-11-27 19:19:53 +00:00
Use ct_run if available; fixes strange issues with getting erl/ct to stop
This commit is contained in:
parent
490d00f0d6
commit
9cf7cf7cb0
1 changed files with 21 additions and 10 deletions
|
@ -192,6 +192,15 @@ make_cmd(TestDir, RawLogDir, Config) ->
|
||||||
""
|
""
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
%% Check for the availability of ct_run; if we can't find it, generate a
|
||||||
|
%% warning and use the old school, less reliable approach to running CT.
|
||||||
|
BaseCmd = case os:find_executable("ct_run") of
|
||||||
|
false ->
|
||||||
|
"erl -noshell -s ct_run script_start -s erlang halt";
|
||||||
|
_ ->
|
||||||
|
"ct_run"
|
||||||
|
end,
|
||||||
|
|
||||||
%% Add the code path of the rebar process to the code path. This
|
%% Add the code path of the rebar process to the code path. This
|
||||||
%% includes the dependencies in the code path. The directories
|
%% includes the dependencies in the code path. The directories
|
||||||
%% that are part of the root Erlang install are filtered out to
|
%% that are part of the root Erlang install are filtered out to
|
||||||
|
@ -203,14 +212,15 @@ make_cmd(TestDir, RawLogDir, Config) ->
|
||||||
CodePathString = string:join(CodeDirs, " "),
|
CodePathString = string:join(CodeDirs, " "),
|
||||||
Cmd = case get_ct_specs(Cwd) of
|
Cmd = case get_ct_specs(Cwd) of
|
||||||
undefined ->
|
undefined ->
|
||||||
?FMT("erl " % should we expand ERL_PATH?
|
?FMT("~s"
|
||||||
" -noshell -pa ~s ~s"
|
" -pa ~s"
|
||||||
|
" ~s"
|
||||||
" ~s"
|
" ~s"
|
||||||
" -logdir \"~s\""
|
" -logdir \"~s\""
|
||||||
" -env TEST_DIR \"~s\""
|
" -env TEST_DIR \"~s\""
|
||||||
" ~s"
|
" ~s",
|
||||||
" -s ct_run script_start -s erlang halt",
|
[BaseCmd,
|
||||||
[CodePathString,
|
CodePathString,
|
||||||
Include,
|
Include,
|
||||||
build_name(Config),
|
build_name(Config),
|
||||||
LogDir,
|
LogDir,
|
||||||
|
@ -222,14 +232,15 @@ make_cmd(TestDir, RawLogDir, Config) ->
|
||||||
get_suites(Config, TestDir) ++
|
get_suites(Config, TestDir) ++
|
||||||
get_case(Config);
|
get_case(Config);
|
||||||
SpecFlags ->
|
SpecFlags ->
|
||||||
?FMT("erl " % should we expand ERL_PATH?
|
?FMT("~s"
|
||||||
" -noshell -pa ~s ~s"
|
" -pa ~s"
|
||||||
|
" ~s"
|
||||||
" ~s"
|
" ~s"
|
||||||
" -logdir \"~s\""
|
" -logdir \"~s\""
|
||||||
" -env TEST_DIR \"~s\""
|
" -env TEST_DIR \"~s\""
|
||||||
" ~s"
|
" ~s",
|
||||||
" -s ct_run script_start -s erlang halt",
|
[BaseCmd,
|
||||||
[CodePathString,
|
CodePathString,
|
||||||
Include,
|
Include,
|
||||||
build_name(Config),
|
build_name(Config),
|
||||||
LogDir,
|
LogDir,
|
||||||
|
|
Loading…
Reference in a new issue