diff options
Diffstat (limited to 'lib/erl_interface/test')
-rw-r--r-- | lib/erl_interface/test/runner.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/erl_interface/test/runner.erl b/lib/erl_interface/test/runner.erl index 9a27eda038..1084eec2a3 100644 --- a/lib/erl_interface/test/runner.erl +++ b/lib/erl_interface/test/runner.erl @@ -55,7 +55,7 @@ test(Tc, Timeout) -> %% Returns: {ok, Port} start({Prog, Tc}) when is_list(Prog), is_integer(Tc) -> - Port = open_port({spawn, Prog}, [{packet, 4}]), + Port = open_port({spawn, Prog}, [{packet, 4}, exit_status]), Command = [Tc div 256, Tc rem 256], Port ! {self(), {command, Command}}, Port. @@ -125,7 +125,9 @@ get_term(Port, Timeout) -> get_reply(Port, Timeout) when is_port(Port) -> receive {Port, {data, Reply}} -> - Reply + Reply; + Fail when element(1, Fail) == Port -> + ct:fail("Got unexpected message from port: ~p",[Fail]) after Timeout -> ct:fail("No response from C program") end. |