Просмотр исходного кода

Start applications directly from the ct hook

Loïc Hoguin 11 лет назад
Родитель
Сommit
b377eb9805
6 измененных файлов с 4 добавлено и 19 удалено
  1. 1 0
      test/cowboy_ct_hook.erl
  2. 0 4
      test/cowboy_test.erl
  3. 1 3
      test/eunit_SUITE.erl
  4. 1 4
      test/http_SUITE.erl
  5. 1 4
      test/spdy_SUITE.erl
  6. 0 4
      test/ws_SUITE.erl

+ 1 - 0
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}.

+ 0 - 4
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) ->

+ 1 - 3
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].

+ 1 - 4
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,

+ 1 - 4
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(),

+ 0 - 4
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"),