aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-04-22 20:52:08 +0200
committerLoïc Hoguin <[email protected]>2014-04-22 20:52:08 +0200
commitb377eb9805de1fc3de0e1d0f1a448505409e9644 (patch)
tree3c338c45247a8e2ff35099dbec0cae2be09861e2 /test
parent75218c4be0e9a2b55c871499668ceba56f7e4aa9 (diff)
downloadcowboy-b377eb9805de1fc3de0e1d0f1a448505409e9644.tar.gz
cowboy-b377eb9805de1fc3de0e1d0f1a448505409e9644.tar.bz2
cowboy-b377eb9805de1fc3de0e1d0f1a448505409e9644.zip
Start applications directly from the ct hook
Diffstat (limited to 'test')
-rw-r--r--test/cowboy_ct_hook.erl1
-rw-r--r--test/cowboy_test.erl4
-rw-r--r--test/eunit_SUITE.erl4
-rw-r--r--test/http_SUITE.erl5
-rw-r--r--test/spdy_SUITE.erl5
-rw-r--r--test/ws_SUITE.erl4
6 files changed, 4 insertions, 19 deletions
diff --git a/test/cowboy_ct_hook.erl b/test/cowboy_ct_hook.erl
index 5eb0587..89f480d 100644
--- a/test/cowboy_ct_hook.erl
+++ b/test/cowboy_ct_hook.erl
@@ -17,6 +17,7 @@
-export([init/2]).
init(_, _) ->
+ cowboy_test:start([cowboy, gun]),
error_logger:tty(false),
error_logger:add_report_handler(cowboy_error_h),
{ok, undefined}.
diff --git a/test/cowboy_test.erl b/test/cowboy_test.erl
index 0dfd36f..786eab6 100644
--- a/test/cowboy_test.erl
+++ b/test/cowboy_test.erl
@@ -30,10 +30,6 @@ do_start(App) ->
do_start(App)
end.
-stop(Apps) ->
- _ = [application:stop(App) || App <- Apps],
- ok.
-
%% Quick configuration value retrieval.
config(Key, Config) ->
diff --git a/test/eunit_SUITE.erl b/test/eunit_SUITE.erl
index 3d015bf..1d817c6 100644
--- a/test/eunit_SUITE.erl
+++ b/test/eunit_SUITE.erl
@@ -13,9 +13,7 @@
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-module(eunit_SUITE).
-
--export([all/0]).
--export([eunit/1]).
+-compile(export_all).
all() ->
[eunit].
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index e9a308f..70ae005 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -72,15 +72,12 @@ groups() ->
].
init_per_suite(Config) ->
- cowboy_test:start([cowboy, gun]),
Dir = config(priv_dir, Config) ++ "/static",
ct_helper:create_static_dir(Dir),
[{static_dir, Dir}|Config].
end_per_suite(Config) ->
- Dir = config(static_dir, Config),
- ct_helper:delete_static_dir(Dir),
- cowboy_test:stop([cowboy, gun]).
+ ct_helper:delete_static_dir(config(static_dir, Config)).
init_tcp_group(Ref, ProtoOpts, Config) ->
Transport = ranch_tcp,
diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl
index c9a81e1..8ed747a 100644
--- a/test/spdy_SUITE.erl
+++ b/test/spdy_SUITE.erl
@@ -31,16 +31,13 @@ init_per_suite(Config) ->
Version when Version < "5.2.1" ->
{skip, "No NPN support in SSL application."};
_ ->
- cowboy_test:start([cowboy, gun]),
Dir = config(priv_dir, Config) ++ "/static",
ct_helper:create_static_dir(Dir),
[{static_dir, Dir}|Config]
end.
end_per_suite(Config) ->
- Dir = config(static_dir, Config),
- ct_helper:delete_static_dir(Dir),
- cowboy_test:stop([cowboy, gun]).
+ ct_helper:delete_static_dir(config(static_dir, Config)).
init_per_group(Name, Config) ->
{_, Cert, Key} = ct_helper:make_certs(),
diff --git a/test/ws_SUITE.erl b/test/ws_SUITE.erl
index 77a7c76..8f4091c 100644
--- a/test/ws_SUITE.erl
+++ b/test/ws_SUITE.erl
@@ -27,12 +27,8 @@ groups() ->
[{autobahn, [], [autobahn_fuzzingclient]}, {ws, [parallel], BaseTests}].
init_per_suite(Config) ->
- cowboy_test:start([cowboy]),
Config.
-end_per_suite(_Config) ->
- cowboy_test:stop([cowboy]).
-
init_per_group(autobahn, Config) ->
%% Some systems have it named pip2.
Out = os:cmd("pip show autobahntestsuite ; pip2 show autobahntestsuite"),