aboutsummaryrefslogtreecommitdiffstats
path: root/test/ws_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-04-22 22:50:45 +0200
committerLoïc Hoguin <[email protected]>2014-04-22 22:50:45 +0200
commit25a17a259056f8343f042553f9a0394309c9d928 (patch)
treed39c924f023196b350ef5ba89c50082d3948e465 /test/ws_SUITE.erl
parentb377eb9805de1fc3de0e1d0f1a448505409e9644 (diff)
downloadcowboy-25a17a259056f8343f042553f9a0394309c9d928.tar.gz
cowboy-25a17a259056f8343f042553f9a0394309c9d928.tar.bz2
cowboy-25a17a259056f8343f042553f9a0394309c9d928.zip
Move listener initialization to cowboy_test
Diffstat (limited to 'test/ws_SUITE.erl')
-rw-r--r--test/ws_SUITE.erl15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/ws_SUITE.erl b/test/ws_SUITE.erl
index 8f4091c..77c82f6 100644
--- a/test/ws_SUITE.erl
+++ b/test/ws_SUITE.erl
@@ -29,7 +29,7 @@ groups() ->
init_per_suite(Config) ->
Config.
-init_per_group(autobahn, Config) ->
+init_per_group(Name = autobahn, Config) ->
%% Some systems have it named pip2.
Out = os:cmd("pip show autobahntestsuite ; pip2 show autobahntestsuite"),
case string:str(Out, "autobahntestsuite") of
@@ -40,21 +40,18 @@ init_per_group(autobahn, Config) ->
"http://autobahn.ws/testsuite/installation.html"),
{skip, "Autobahn Test Suite not installed."};
_ ->
- {ok, _} = cowboy:start_http(autobahn, 100, [{port, 33080}], [
+ {ok, _} = cowboy:start_http(Name, 100, [{port, 33080}], [
{env, [{dispatch, init_dispatch()}]}]),
Config
end;
-init_per_group(ws, Config) ->
- cowboy:start_http(ws, 100, [{port, 0}], [
+init_per_group(Name = ws, Config) ->
+ cowboy_test:init_http(Name, [
{env, [{dispatch, init_dispatch()}]},
{compress, true}
- ]),
- Port = ranch:get_port(ws),
- [{port, Port}|Config].
+ ], Config).
end_per_group(Listener, _Config) ->
- cowboy:stop_listener(Listener),
- ok.
+ cowboy:stop_listener(Listener).
%% Dispatch configuration.