mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Start applications directly from the ct hook
This commit is contained in:
parent
75218c4be0
commit
b377eb9805
6 changed files with 4 additions and 19 deletions
|
@ -17,6 +17,7 @@
|
||||||
-export([init/2]).
|
-export([init/2]).
|
||||||
|
|
||||||
init(_, _) ->
|
init(_, _) ->
|
||||||
|
cowboy_test:start([cowboy, gun]),
|
||||||
error_logger:tty(false),
|
error_logger:tty(false),
|
||||||
error_logger:add_report_handler(cowboy_error_h),
|
error_logger:add_report_handler(cowboy_error_h),
|
||||||
{ok, undefined}.
|
{ok, undefined}.
|
||||||
|
|
|
@ -30,10 +30,6 @@ do_start(App) ->
|
||||||
do_start(App)
|
do_start(App)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
stop(Apps) ->
|
|
||||||
_ = [application:stop(App) || App <- Apps],
|
|
||||||
ok.
|
|
||||||
|
|
||||||
%% Quick configuration value retrieval.
|
%% Quick configuration value retrieval.
|
||||||
|
|
||||||
config(Key, Config) ->
|
config(Key, Config) ->
|
||||||
|
|
|
@ -13,9 +13,7 @@
|
||||||
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
-module(eunit_SUITE).
|
-module(eunit_SUITE).
|
||||||
|
-compile(export_all).
|
||||||
-export([all/0]).
|
|
||||||
-export([eunit/1]).
|
|
||||||
|
|
||||||
all() ->
|
all() ->
|
||||||
[eunit].
|
[eunit].
|
||||||
|
|
|
@ -72,15 +72,12 @@ groups() ->
|
||||||
].
|
].
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
cowboy_test:start([cowboy, gun]),
|
|
||||||
Dir = config(priv_dir, Config) ++ "/static",
|
Dir = config(priv_dir, Config) ++ "/static",
|
||||||
ct_helper:create_static_dir(Dir),
|
ct_helper:create_static_dir(Dir),
|
||||||
[{static_dir, Dir}|Config].
|
[{static_dir, Dir}|Config].
|
||||||
|
|
||||||
end_per_suite(Config) ->
|
end_per_suite(Config) ->
|
||||||
Dir = config(static_dir, Config),
|
ct_helper:delete_static_dir(config(static_dir, Config)).
|
||||||
ct_helper:delete_static_dir(Dir),
|
|
||||||
cowboy_test:stop([cowboy, gun]).
|
|
||||||
|
|
||||||
init_tcp_group(Ref, ProtoOpts, Config) ->
|
init_tcp_group(Ref, ProtoOpts, Config) ->
|
||||||
Transport = ranch_tcp,
|
Transport = ranch_tcp,
|
||||||
|
|
|
@ -31,16 +31,13 @@ init_per_suite(Config) ->
|
||||||
Version when Version < "5.2.1" ->
|
Version when Version < "5.2.1" ->
|
||||||
{skip, "No NPN support in SSL application."};
|
{skip, "No NPN support in SSL application."};
|
||||||
_ ->
|
_ ->
|
||||||
cowboy_test:start([cowboy, gun]),
|
|
||||||
Dir = config(priv_dir, Config) ++ "/static",
|
Dir = config(priv_dir, Config) ++ "/static",
|
||||||
ct_helper:create_static_dir(Dir),
|
ct_helper:create_static_dir(Dir),
|
||||||
[{static_dir, Dir}|Config]
|
[{static_dir, Dir}|Config]
|
||||||
end.
|
end.
|
||||||
|
|
||||||
end_per_suite(Config) ->
|
end_per_suite(Config) ->
|
||||||
Dir = config(static_dir, Config),
|
ct_helper:delete_static_dir(config(static_dir, Config)).
|
||||||
ct_helper:delete_static_dir(Dir),
|
|
||||||
cowboy_test:stop([cowboy, gun]).
|
|
||||||
|
|
||||||
init_per_group(Name, Config) ->
|
init_per_group(Name, Config) ->
|
||||||
{_, Cert, Key} = ct_helper:make_certs(),
|
{_, Cert, Key} = ct_helper:make_certs(),
|
||||||
|
|
|
@ -27,12 +27,8 @@ groups() ->
|
||||||
[{autobahn, [], [autobahn_fuzzingclient]}, {ws, [parallel], BaseTests}].
|
[{autobahn, [], [autobahn_fuzzingclient]}, {ws, [parallel], BaseTests}].
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
cowboy_test:start([cowboy]),
|
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
|
||||||
cowboy_test:stop([cowboy]).
|
|
||||||
|
|
||||||
init_per_group(autobahn, Config) ->
|
init_per_group(autobahn, Config) ->
|
||||||
%% Some systems have it named pip2.
|
%% Some systems have it named pip2.
|
||||||
Out = os:cmd("pip show autobahntestsuite ; pip2 show autobahntestsuite"),
|
Out = os:cmd("pip show autobahntestsuite ; pip2 show autobahntestsuite"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue