Skip to content

Commit

Permalink
Replace use of test_server:format/2 with io:format/2
Browse files Browse the repository at this point in the history
  • Loading branch information
psyeugenic committed Apr 6, 2016
1 parent 66668a6 commit 7c9936f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions erts/test/erl_print_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ chk_display(Term, Expect) when is_list(Expect) ->
Dstr = erts_debug:display(Term),
case Expect ++ io_lib:nl() of
Dstr ->
?t:format("Test of \"~p\" succeeded.~n"
io:format("Test of \"~p\" succeeded.~n"
" Expected and got: ~s~n",
[Term, io_lib:write_string(Dstr)]);
DoExpect ->
?t:format("***~n"
io:format("***~n"
"*** Test of \"~p\" failed!~n"
"*** Expected: ~s~n"
"*** Got: ~s~n"
Expand Down Expand Up @@ -240,14 +240,14 @@ port_prog_killer(EProc, OSProc) when is_pid(EProc), is_list(OSProc) ->
element(1, Reason)
== timetrap_timeout ->
Cmd = "kill -9 " ++ OSProc,
?t:format("Test case timed out. "
io:format("Test case timed out. "
"Trying to kill port program.~n"
" Executing: ~p~n", [Cmd]),
case os:cmd(Cmd) of
[] ->
ok;
OsCmdRes ->
?t:format(" ~s", [OsCmdRes])
io:format(" ~s", [OsCmdRes])
end;
{'DOWN', Ref, _, _, _} ->
%% OSProc is assumed to have terminated by itself
Expand Down Expand Up @@ -275,7 +275,7 @@ read_case_data(Port, TestCase) ->
{Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
ct:fail(get_line(Port, Flag, ReasonStart));
{Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
?t:format("Port program pid: ~s~n", [PidStr]),
io:format("Port program pid: ~s~n", [PidStr]),
CaseProc = self(),
_ = list_to_integer(PidStr), % Sanity check
spawn_opt(fun () ->
Expand All @@ -284,7 +284,7 @@ read_case_data(Port, TestCase) ->
[{priority, max}, link]),
read_case_data(Port, TestCase);
{Port, {data, {Flag, LineStart}}} ->
?t:format("~s~n", [get_line(Port, Flag, LineStart)]),
io:format("~s~n", [get_line(Port, Flag, LineStart)]),
read_case_data(Port, TestCase);
{Port, eof} ->
ct:fail(port_prog_unexpectedly_closed)
Expand Down
8 changes: 4 additions & 4 deletions erts/test/ethread_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ port_prog_killer(EProc, OSProc) when is_pid(EProc), is_list(OSProc) ->
element(1, Reason)
== timetrap_timeout ->
Cmd = "kill -9 " ++ OSProc,
?t:format("Test case timed out. "
io:format("Test case timed out. "
"Trying to kill port program.~n"
" Executing: ~p~n", [Cmd]),
case os:cmd(Cmd) of
[] ->
ok;
OsCmdRes ->
?t:format(" ~s", [OsCmdRes])
io:format(" ~s", [OsCmdRes])
end;
%% OSProc is assumed to have terminated by itself
{'DOWN', Ref, _, _, _} ->
Expand Down Expand Up @@ -255,7 +255,7 @@ read_case_data(Port, TestCase) ->
{Port, {data, {Flag, [?FAILED_MARKER | ReasonStart]}}} ->
ct:fail(get_line(Port, Flag, ReasonStart));
{Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
?t:format("Port program pid: ~s~n", [PidStr]),
io:format("Port program pid: ~s~n", [PidStr]),
CaseProc = self(),
_ = list_to_integer(PidStr), % Sanity check
spawn_opt(fun () ->
Expand All @@ -264,7 +264,7 @@ read_case_data(Port, TestCase) ->
[{priority, max}, link]),
read_case_data(Port, TestCase);
{Port, {data, {Flag, LineStart}}} ->
?t:format("~s~n", [get_line(Port, Flag, LineStart)]),
io:format("~s~n", [get_line(Port, Flag, LineStart)]),
read_case_data(Port, TestCase);
{Port, eof} ->
ct:fail(port_prog_unexpectedly_closed)
Expand Down
16 changes: 8 additions & 8 deletions erts/test/install_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,13 @@ bin_no_srcfile(Config) when is_list(Config) ->
%%

expect(X, X) ->
?t:format("result: ~p~n", [X]),
?t:format("-----------------------------------------------~n", []),
io:format("result: ~p~n", [X]),
io:format("-----------------------------------------------~n", []),
ok;
expect(X, Y) ->
?t:format("expected: ~p~n", [X]),
?t:format("got : ~p~n", [Y]),
?t:format("-----------------------------------------------~n", []),
io:format("expected: ~p~n", [X]),
io:format("got : ~p~n", [Y]),
io:format("-----------------------------------------------~n", []),
ct:fail({X,Y}).

init_per_suite(Config) ->
Expand Down Expand Up @@ -690,7 +690,7 @@ install_bin3(Config,
++ "\" --exec-prefix \"" ++ EXEC_PREFIX
++ "\" --test-file \"" ++ ResFile ++ "\" erl erlc",

?t:format("CMD_PRFX = \"~s\"~n"
io:format("CMD_PRFX = \"~s\"~n"
"LN_S = \"~s\"~n"
"BINDIR_SYMLINKS = \"~s\"~n"
"exec_prefix = \"~s\"~n"
Expand All @@ -701,9 +701,9 @@ install_bin3(Config,
[CMD_PRFX, LN_S, BINDIR_SYMLINKS, EXEC_PREFIX, BINDIR,
ERLANG_BINDIR, EXTRA_PREFIX, DESTDIR]),

?t:format("$ ~s~n", [Cmd]),
io:format("$ ~s~n", [Cmd]),
CmdOutput = os:cmd(Cmd),
?t:format("~s~n", [CmdOutput]),
io:format("~s~n", [CmdOutput]),
ChkRes(case file:consult(ResFile) of
{ok, [Res]} -> Res;
Err -> exit({result, Err})
Expand Down

0 comments on commit 7c9936f

Please sign in to comment.