aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-04-26 10:09:15 +0200
committerLukas Larsson <[email protected]>2016-04-26 10:09:15 +0200
commit76cf34c49631845a21ffdd6d317d7fc944ab9b7b (patch)
tree5188955efe65ed9199aeb734579ce587ac9a847e /lib/common_test
parent04d15ab3de2580ce9e62bd1799253a86fcb32481 (diff)
parent9af03334bc3c48798c28d6ead4a02cb1bcd3fe30 (diff)
downloadotp-76cf34c49631845a21ffdd6d317d7fc944ab9b7b.tar.gz
otp-76cf34c49631845a21ffdd6d317d7fc944ab9b7b.tar.bz2
otp-76cf34c49631845a21ffdd6d317d7fc944ab9b7b.zip
Merge branch 'lukas/ts/exit_status/OTP-13515'
* lukas/ts/exit_status/OTP-13515: ts: Add logging of exit_status from test node
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/test_server/ts_run.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/common_test/test_server/ts_run.erl b/lib/common_test/test_server/ts_run.erl
index a856fc6f8d..66db1ff9a7 100644
--- a/lib/common_test/test_server/ts_run.erl
+++ b/lib/common_test/test_server/ts_run.erl
@@ -261,7 +261,7 @@ run_batch(Vars, _Spec, State) ->
Command = State#state.command ++ " -noinput -s erlang halt",
ts_lib:progress(Vars, 1, "Command: ~ts~n", [Command]),
io:format(user, "Command: ~ts~n",[Command]),
- Port = open_port({spawn, Command}, [stream, in, eof]),
+ Port = open_port({spawn, Command}, [stream, in, eof, exit_status]),
Timeout = 30000 * case os:getenv("TS_RUN_VALGRIND") of
false -> 1;
_ -> 100
@@ -284,7 +284,16 @@ tricky_print_data(Port, Timeout) ->
ok
after 1 -> % force context switch
ok
- end
+ end,
+ receive
+ {Port, {exit_status, 0}} ->
+ ok;
+ {Port, {exit_status, N}} ->
+ io:format(user, "Test run exited with status ~p~n", [N])
+ after 1 ->
+ %% This shouldn't happen, but better safe then hanging
+ ok
+ end
after Timeout ->
case erl_epmd:names() of
{ok,Names} ->