diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2013-06-15 10:54:29 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2013-06-24 21:46:24 +0200 |
commit | edd835510b62c88bdc451839f1a34ceeb06cbd66 (patch) | |
tree | 0abfd3239ad966fbb9a35fe841dffad394e3847c /src | |
parent | ec1f503946ce32712e85dc8c36024d3380f700b8 (diff) |
rebar_ct: fix Dialyzer warning caused by bcc57e9b
Also fix a single line exceeding max column.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_ct.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index 9951f8e..66b9d76 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -108,7 +108,8 @@ run_test(TestDir, LogDir, Config, _File) -> " 2>&1 | tee -a " ++ RawLog end, - case rebar_utils:sh(Cmd ++ Output, [{env,[{"TESTDIR", TestDir}]}, return_on_error]) of + ShOpts = [{env,[{"TESTDIR", TestDir}]}, return_on_error], + case rebar_utils:sh(Cmd ++ Output, ShOpts) of {ok,_} -> %% in older versions of ct_run, this could have been a failure %% that returned a non-0 code. Check for that! @@ -135,11 +136,16 @@ clear_log(LogDir, RawLog) -> check_success_log(Config, RawLog) -> check_log(Config, RawLog, fun(Msg) -> ?CONSOLE("DONE.\n~s\n", [Msg]) end). -check_fail_log(Config, RawLog, Command, {Rc, Output}) -> - check_log(Config, RawLog, fun(_Msg) -> +-type err_handler() :: fun((string()) -> no_return()). +-spec failure_logger(string(), {integer(), string()}) -> err_handler(). +failure_logger(Command, {Rc, Output}) -> + fun(_Msg) -> ?ABORT("~s failed with error: ~w and output:~n~s~n", [Command, Rc, Output]) - end). + end. + +check_fail_log(Config, RawLog, Command, Result) -> + check_log(Config, RawLog, failure_logger(Command, Result)). check_log(Config,RawLog,Fun) -> {ok, Msg} = |