0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Start applications directly from the ct hook

This commit is contained in:
Loïc Hoguin 2014-04-22 20:52:08 +02:00
parent 75218c4be0
commit b377eb9805
6 changed files with 4 additions and 19 deletions

View file

@ -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}.

View file

@ -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) ->

View file

@ -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].

View file

@ -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,

View file

@ -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(),

View file

@ -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"),