4
%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
19
-module(groups_21_SUITE).
23
-include_lib("common_test/include/ct.hrl").
25
%%====================================================================
26
%% COMMON TEST CALLBACK FUNCTIONS
27
%%====================================================================
30
[{timetrap,{minutes,1}}].
34
{test_group_1a, [testcase_1a,testcase_1b]},
36
{test_group_1b, [], [testcase_1a,testcase_1b]},
38
{test_group_2, [], [testcase_2a,
40
{test_group_3, [], [testcase_3a,
44
{test_group_4, [{test_group_5, [], [testcase_5a,
46
{group, test_group_6},
50
{test_group_6, [{group, test_group_7}]},
52
{test_group_7, [testcase_7a,testcase_7b]}
57
{group, test_group_1a},
58
{group, test_group_1b},
60
{group, test_group_2},
62
{group, test_group_4}].
64
%% this func only for internal test purposes
67
test_group_1a, test_group_1b,
68
test_group_2, test_group_3,
69
test_group_4, test_group_5,
70
test_group_6, test_group_7
74
testcase_1a, testcase_1b,
76
testcase_2a, testcase_2b,
77
testcase_3a, testcase_3b,
79
testcase_5a, testcase_5b,
80
testcase_7a, testcase_7b
83
%%--------------------------------------------------------------------
84
%% Suite Configuration
85
%%--------------------------------------------------------------------
87
init_per_suite(Config) ->
88
[{suite,init}|Config].
90
end_per_suite(Config) ->
91
init = ?config(suite,Config).
93
%%--------------------------------------------------------------------
94
%% Group Configuration
95
%%--------------------------------------------------------------------
97
init_per_group(Group, Config) ->
98
[{name,Group}] = ?config(tc_group_properties,Config),
99
{Grs,_} = grs_and_tcs(),
100
case lists:member(Group, Grs) of
102
init = ?config(suite,Config),
103
[{Group,Group} | Config];
105
ct:fail({bad_group,Group})
108
end_per_group(Group, Config) ->
109
{Grs,_} = grs_and_tcs(),
110
case lists:member(Group, Grs) of
112
init = ?config(suite,Config),
113
Group = ?config(Group,Config),
116
ct:fail({bad_group,Group})
119
%%--------------------------------------------------------------------
120
%% Testcase Configuration
121
%%--------------------------------------------------------------------
123
init_per_testcase(TestCase, Config) ->
124
{_,TCs} = grs_and_tcs(),
125
case lists:member(TestCase, TCs) of
127
init = ?config(suite,Config),
128
[{TestCase,TestCase} | Config];
130
ct:fail({unknown_testcase,TestCase})
133
end_per_testcase(TestCase, Config) ->
134
{_,TCs} = grs_and_tcs(),
135
case lists:member(TestCase, TCs) of
137
init = ?config(suite,Config),
138
TestCase = ?config(TestCase,Config),
141
ct:fail({unknown_testcase,TestCase})
145
%%--------------------------------------------------------------------
147
%%--------------------------------------------------------------------
151
testcase_1(Config) ->
152
init = ?config(suite,Config),
153
testcase_1 = ?config(testcase_1,Config),
158
testcase_1a(Config) ->
159
init = ?config(suite,Config),
160
case ?config(test_group_1a,Config) of
163
case ?config(test_group_1b,Config) of
165
_ -> ct:fail(no_group_data)
168
testcase_1a = ?config(testcase_1a,Config),
172
testcase_1b(Config) ->
173
init = ?config(suite,Config),
174
case ?config(test_group_1a,Config) of
177
case ?config(test_group_1b,Config) of
179
_ -> ct:fail(no_group_data)
182
undefined = ?config(testcase_1a,Config),
183
testcase_1b = ?config(testcase_1b,Config),
188
testcase_2(Config) ->
189
init = ?config(suite,Config),
190
undefined = ?config(test_group_1a,Config),
191
undefined = ?config(test_group_1b,Config),
192
testcase_2 = ?config(testcase_2,Config),
197
testcase_2a(Config) ->
198
init = ?config(suite,Config),
199
test_group_2 = ?config(test_group_2,Config),
200
testcase_2a = ?config(testcase_2a,Config),
204
testcase_2b(Config) ->
205
init = ?config(suite,Config),
206
test_group_2 = ?config(test_group_2,Config),
207
undefined = ?config(testcase_2a,Config),
208
testcase_2b = ?config(testcase_2b,Config),
213
testcase_3a(Config) ->
214
init = ?config(suite,Config),
215
test_group_2 = ?config(test_group_2,Config),
216
test_group_3 = ?config(test_group_3,Config),
217
undefined = ?config(testcase_2b,Config),
218
testcase_3a = ?config(testcase_3a,Config),
222
testcase_3b(Config) ->
223
init = ?config(suite,Config),
224
test_group_2 = ?config(test_group_2,Config),
225
test_group_3 = ?config(test_group_3,Config),
226
undefined = ?config(testcase_3a,Config),
227
testcase_3b = ?config(testcase_3b,Config),
232
testcase_3(Config) ->
233
init = ?config(suite,Config),
234
undefined = ?config(test_group_2,Config),
235
undefined = ?config(test_group_3,Config),
236
testcase_3 = ?config(testcase_3,Config),
241
testcase_5a(Config) ->
242
init = ?config(suite,Config),
243
undefined = ?config(test_group_3,Config),
244
test_group_4 = ?config(test_group_4,Config),
245
test_group_5 = ?config(test_group_5,Config),
246
undefined = ?config(testcase_3,Config),
247
testcase_5a = ?config(testcase_5a,Config),
251
testcase_5b(Config) ->
252
init = ?config(suite,Config),
253
test_group_4 = ?config(test_group_4,Config),
254
test_group_5 = ?config(test_group_5,Config),
255
undefined = ?config(testcase_5a,Config),
256
testcase_5b = ?config(testcase_5b,Config),
261
testcase_7a(Config) ->
262
init = ?config(suite,Config),
263
undefined = ?config(test_group_3,Config),
264
test_group_4 = ?config(test_group_4,Config),
265
test_group_5 = ?config(test_group_5,Config),
266
test_group_6 = ?config(test_group_6,Config),
267
test_group_7 = ?config(test_group_7,Config),
268
testcase_7a = ?config(testcase_7a,Config),
272
testcase_7b(Config) ->
273
init = ?config(suite,Config),
274
test_group_4 = ?config(test_group_4,Config),
275
test_group_5 = ?config(test_group_5,Config),
276
test_group_6 = ?config(test_group_6,Config),
277
test_group_7 = ?config(test_group_7,Config),
278
undefined = ?config(testcase_7a,Config),
279
testcase_7b = ?config(testcase_7b,Config),