aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-03-07 19:02:58 +0100
committerSverker Eriksson <[email protected]>2016-03-07 19:02:58 +0100
commit48d6955eca25d2d9fec0a0a6a4c70ef6ddb85e41 (patch)
tree3734a4e747761532ebcca4bf725826e5a51568d8
parentc5ef73b4a587bf8f2e7b7b3d74fe917fdbe6153f (diff)
downloadotp-48d6955eca25d2d9fec0a0a6a4c70ef6ddb85e41.tar.gz
otp-48d6955eca25d2d9fec0a0a6a4c70ef6ddb85e41.tar.bz2
otp-48d6955eca25d2d9fec0a0a6a4c70ef6ddb85e41.zip
stdlib: Fix io_SUITE:bad_printable_range for windows
avoid os:cmd as it treats stderr different on windows.
-rw-r--r--lib/stdlib/test/io_SUITE.erl24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index 0e897631ff..bb1ed2a4fc 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -2125,12 +2125,24 @@ rpc_call_max(Node, M, F, Args) ->
%% Make sure that a bad specification for a printable range is rejected.
bad_printable_range(Config) when is_list(Config) ->
Cmd = lists:concat([lib:progname()," +pcunnnnnicode -run erlang halt"]),
- case os:cmd(Cmd) of
- "bad range of printable characters" ++ _ ->
- ok;
- String ->
- io:format("~s\n", [String]),
- ?t:fail()
+ P = open_port({spawn, Cmd}, [stderr_to_stdout, {line, 200}]),
+ ok = receive
+ {P, {data, {eol , "bad range of printable characters" ++ _}}} ->
+ ok;
+ Other ->
+ Other
+ after 1000 ->
+ timeout
+ end,
+ catch port_close(P),
+ flush_from_port(P),
+ ok.
+
+flush_from_port(P) ->
+ receive {P, _} ->
+ flush_from_port(P)
+ after 0 ->
+ ok
end.
io_lib_print_binary_depth_one(doc) ->