aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/async_ports_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-03-08 19:35:31 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-03-11 15:43:10 +0100
commitc062dfc485ad0d51d648701950f77ef8f51d4f35 (patch)
treebc504742a0bdaea8d5cfbe1cd34625b25c78023a /erts/emulator/test/async_ports_SUITE.erl
parent9042f9f26fc42fc108c3e3711cf3bfdae2d3312d (diff)
downloadotp-c062dfc485ad0d51d648701950f77ef8f51d4f35.tar.gz
otp-c062dfc485ad0d51d648701950f77ef8f51d4f35.tar.bz2
otp-c062dfc485ad0d51d648701950f77ef8f51d4f35.zip
Modernize use of timetraps
Diffstat (limited to 'erts/emulator/test/async_ports_SUITE.erl')
-rw-r--r--erts/emulator/test/async_ports_SUITE.erl37
1 files changed, 18 insertions, 19 deletions
diff --git a/erts/emulator/test/async_ports_SUITE.erl b/erts/emulator/test/async_ports_SUITE.erl
index c89b3655ff..9647d87c32 100644
--- a/erts/emulator/test/async_ports_SUITE.erl
+++ b/erts/emulator/test/async_ports_SUITE.erl
@@ -1,8 +1,10 @@
-module(async_ports_SUITE).
--include_lib("common_test/include/ct.hrl").
+-export([all/0, suite/0]).
+-export([permanent_busy_test/1]).
+-export([run_loop/5]).
--compile(export_all).
+-include_lib("common_test/include/ct.hrl").
-define(PACKET_SIZE, (10 * 1024 * 8)).
-define(CPORT_DELAY, 100).
@@ -11,17 +13,15 @@
-define(TEST_PROCS_COUNT, 2).
-define(TC_TIMETRAP_SECONDS, 10).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap, {seconds, ?TC_TIMETRAP_SECONDS}}].
all() ->
- [
- permanent_busy_test
- ].
+ [permanent_busy_test].
permanent_busy_test(Config) ->
- ct:timetrap({seconds, ?TC_TIMETRAP_SECONDS}),
ExePath = filename:join(?config(data_dir, Config), "cport"),
-
Self = self(),
spawn_link(
fun() ->
@@ -29,17 +29,16 @@ permanent_busy_test(Config) ->
Port = open_port(ExePath),
- Testers =
- lists:map(
- fun(_) ->
- erlang:spawn_link(?MODULE, run_loop,
- [Self,
- Port,
- Block,
- ?TEST_LOOPS_COUNT,
- 0])
- end,
- lists:seq(1, ?TEST_PROCS_COUNT)),
+ Testers = lists:map(
+ fun(_) ->
+ spawn_link(?MODULE, run_loop,
+ [Self,
+ Port,
+ Block,
+ ?TEST_LOOPS_COUNT,
+ 0])
+ end,
+ lists:seq(1, ?TEST_PROCS_COUNT)),
Self ! {test_info, Port, Testers},
endless_flush(Port)
end),