diff options
author | Björn Gustavsson <[email protected]> | 2015-09-04 10:32:07 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-09-11 12:24:36 +0200 |
commit | ccee216a6cc1bc619806007891e9d9d9c30e8826 (patch) | |
tree | fb31bb49b4e0bd76fb0ab917702754378be8afe2 /lib/stdlib | |
parent | 88d3f61e3724957f60c9e8a786e8533d8aa1f362 (diff) | |
download | otp-ccee216a6cc1bc619806007891e9d9d9c30e8826.tar.gz otp-ccee216a6cc1bc619806007891e9d9d9c30e8826.tar.bz2 otp-ccee216a6cc1bc619806007891e9d9d9c30e8826.zip |
io_proto_SUITE: Speed up determination of default shell
Use getline_pred action that fails fast if the shell is not
the oldshell, to avoid having to wait for the timeout.
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/test/io_proto_SUITE.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 658c6442b1..811c7ed7bb 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -1791,10 +1791,22 @@ get_data_within(Port, Timeout, Acc) -> end. get_default_shell() -> + Match = fun(Data) -> + case lists:prefix("undefined", Data) of + true -> + yes; + false -> + case re:run(Data, "<\\d+[.]\\d+[.]\\d+>", + [{capture,none}]) of + match -> no; + _ -> maybe + end + end + end, try rtnode([{putline,""}, {putline, "whereis(user_drv)."}, - {getline, "undefined"}],[]), + {getline_pred, Match, "matching of user_drv pid"}], []), old catch _E:_R -> ?dbg({_E,_R}), |