aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/global_group_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2010-10-12 10:38:51 +0200
committerLukas Larsson <[email protected]>2011-02-17 17:25:13 +0100
commit8bd07f450816eaaae52d28740d89ead1f930cd02 (patch)
tree0dd5bb7fdaa94978d9326c693f94bb992229b0c2 /lib/kernel/test/global_group_SUITE.erl
parent670f41232381c6c1a47101349567caf9303dea8f (diff)
downloadotp-8bd07f450816eaaae52d28740d89ead1f930cd02.tar.gz
otp-8bd07f450816eaaae52d28740d89ead1f930cd02.tar.bz2
otp-8bd07f450816eaaae52d28740d89ead1f930cd02.zip
Update kernel tests to conform with common_test standard
Diffstat (limited to 'lib/kernel/test/global_group_SUITE.erl')
-rw-r--r--lib/kernel/test/global_group_SUITE.erl46
1 files changed, 40 insertions, 6 deletions
diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl
index 301f1246c2..a94944c0e9 100644
--- a/lib/kernel/test/global_group_SUITE.erl
+++ b/lib/kernel/test/global_group_SUITE.erl
@@ -19,7 +19,8 @@
-module(global_group_SUITE).
--export([all/1]).
+-export([all/0,groups/0,init_per_group/2,end_per_group/2,
+ init_per_suite/1, end_per_suite/1]).
-export([start_gg_proc/1, no_gg_proc/1, no_gg_proc_sync/1, compatible/1,
one_grp/1, one_grp_x/1, two_grp/1, hidden_groups/1, test_exit/1]).
-export([init/1, init/2, init2/2, start_proc/1, start_proc_rereg/1]).
@@ -28,16 +29,49 @@
%-compile(export_all).
--include("test_server.hrl").
+-include_lib("test_server/include/test_server.hrl").
-define(NODES, [node()|nodes()]).
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end)).
-all(suite) ->
- [start_gg_proc, no_gg_proc, no_gg_proc_sync,
- compatible, one_grp, one_grp_x, two_grp, test_exit,
- hidden_groups].
+all() ->
+[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible,
+ one_grp, one_grp_x, two_grp, test_exit, hidden_groups].
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+init_per_suite(Config) ->
+
+ %% Copied from test_server_ctrl ln 647, we have to do this here as
+ %% the test_server only does this when run without common_test
+ global:sync(),
+ case global:whereis_name(test_server) of
+ undefined ->
+ io:format(user, "Registering test_server globally!~n",[]),
+ global:register_name(test_server, whereis(test_server_ctrl));
+ Pid ->
+ case node() of
+ N when N == node(Pid) ->
+ io:format(user, "Warning: test_server already running!\n", []),
+ global:re_register_name(test_server,self());
+ _ ->
+ ok
+ end
+ end,
+ Config.
+
+end_per_suite(_Config) ->
+ global:unregister_name(test_server),
+ ok.
-define(TESTCASE, testcase_name).
-define(testcase, ?config(?TESTCASE, Config)).