aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test_server/ts_run.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-05-09 09:52:33 +0200
committerRaimo Niskanen <[email protected]>2016-05-09 09:52:33 +0200
commit7ef564a791a8ca49f303260a82448f2d2a244be4 (patch)
treeb2abafa1878f7737acc97b7c888e10d57fb05729 /lib/common_test/test_server/ts_run.erl
parent1f145f8a444121fac1f15dfe4af54f2148419ac1 (diff)
parent09d138e229846b7056331151135b7c8a52dc476f (diff)
downloadotp-7ef564a791a8ca49f303260a82448f2d2a244be4.tar.gz
otp-7ef564a791a8ca49f303260a82448f2d2a244be4.tar.bz2
otp-7ef564a791a8ca49f303260a82448f2d2a244be4.zip
Merge branch 'xsipewe_gen_statem1' of https://github.com/xsipewe/otp into raimo/polish-gen_statem/OTP-13065
Conflicts: lib/stdlib/doc/src/gen_statem.xml
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 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} ->