mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix indentation in rebar_ct
This commit is contained in:
parent
3b0568ebb7
commit
bb6731208e
1 changed files with 20 additions and 20 deletions
|
@ -77,13 +77,13 @@ run_test(TestDir, Config, _File) ->
|
||||||
|
|
||||||
clear_log(RawLog) ->
|
clear_log(RawLog) ->
|
||||||
case filelib:ensure_dir("logs/index.html") of
|
case filelib:ensure_dir("logs/index.html") of
|
||||||
ok ->
|
ok ->
|
||||||
NowStr = rebar_utils:now_str(),
|
NowStr = rebar_utils:now_str(),
|
||||||
LogHeader = "--- Test run on " ++ NowStr ++ " ---\n",
|
LogHeader = "--- Test run on " ++ NowStr ++ " ---\n",
|
||||||
ok = file:write_file(RawLog, LogHeader);
|
ok = file:write_file(RawLog, LogHeader);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% calling ct with erl does not return non-zero on failure - have to check
|
%% calling ct with erl does not return non-zero on failure - have to check
|
||||||
|
@ -96,28 +96,28 @@ check_log(RawLog) ->
|
||||||
RunFailed = string:str(Msg, ", 0 failed") =:= 0,
|
RunFailed = string:str(Msg, ", 0 failed") =:= 0,
|
||||||
if
|
if
|
||||||
MakeFailed ->
|
MakeFailed ->
|
||||||
show_log(RawLog),
|
show_log(RawLog),
|
||||||
?ERROR("Building tests failed\n",[]),
|
?ERROR("Building tests failed\n",[]),
|
||||||
?FAIL;
|
?FAIL;
|
||||||
|
|
||||||
RunFailed ->
|
RunFailed ->
|
||||||
show_log(RawLog),
|
show_log(RawLog),
|
||||||
?ERROR("One or more tests failed\n",[]),
|
?ERROR("One or more tests failed\n",[]),
|
||||||
?FAIL;
|
?FAIL;
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
?CONSOLE("DONE. ~s\n", [Msg])
|
?CONSOLE("DONE. ~s\n", [Msg])
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% Show the log if it hasn't already been shown because verbose was on
|
%% Show the log if it hasn't already been shown because verbose was on
|
||||||
show_log(RawLog) ->
|
show_log(RawLog) ->
|
||||||
?CONSOLE("Showing log\n", []),
|
?CONSOLE("Showing log\n", []),
|
||||||
case rebar_config:get_global(verbose, "0") of
|
case rebar_config:get_global(verbose, "0") of
|
||||||
"0" ->
|
"0" ->
|
||||||
{ok, Contents} = file:read_file(RawLog),
|
{ok, Contents} = file:read_file(RawLog),
|
||||||
?CONSOLE("~s", [Contents]);
|
?CONSOLE("~s", [Contents]);
|
||||||
_ ->
|
_ ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
make_cmd(TestDir, Config) ->
|
make_cmd(TestDir, Config) ->
|
||||||
|
|
Loading…
Reference in a new issue