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]).
|
||||
|
||||
init(_, _) ->
|
||||
cowboy_test:start([cowboy, gun]),
|
||||
error_logger:tty(false),
|
||||
error_logger:add_report_handler(cowboy_error_h),
|
||||
{ok, undefined}.
|
||||
|
|
|
@ -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) ->
|
||||
|
|
|
@ -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].
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue