From fafacbdb5c3b8852e29da51933b708bbc57e8a0b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 3 Jun 2016 11:26:32 +0200 Subject: erl_interface: Fix trace level tracing on windows --- lib/erl_interface/src/misc/show_msg.c | 2 ++ lib/erl_interface/test/runner.erl | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c index 81accab4b6..5868cccba6 100644 --- a/lib/erl_interface/src/misc/show_msg.c +++ b/lib/erl_interface/src/misc/show_msg.c @@ -40,6 +40,8 @@ # include # endif # endif +#else +# include #endif #include "eiext.h" 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. -- cgit v1.2.3