aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test_server/ts_run.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-04-05 16:36:18 +0200
committerLukas Larsson <[email protected]>2016-04-05 16:38:03 +0200
commit9af03334bc3c48798c28d6ead4a02cb1bcd3fe30 (patch)
tree424fd538b590b2b5e41aadb392c1278ba242bbd8 /lib/common_test/test_server/ts_run.erl
parentad46aea945c946ea07d7369d9513d3e66442378f (diff)
downloadotp-9af03334bc3c48798c28d6ead4a02cb1bcd3fe30.tar.gz
otp-9af03334bc3c48798c28d6ead4a02cb1bcd3fe30.tar.bz2
otp-9af03334bc3c48798c28d6ead4a02cb1bcd3fe30.zip
ts: Add logging of exit_status from test node
Diffstat (limited to 'lib/common_test/test_server/ts_run.erl')
-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 188094921d..844f4b2abe 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} ->