~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/common_test/test/ct_testspec_1_SUITE_data/groups_2/groups_21_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 2010. All Rights Reserved.
 
5
%%
 
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/.
 
11
%%
 
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
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
-module(groups_21_SUITE).
 
20
 
 
21
-compile(export_all).
 
22
 
 
23
-include_lib("common_test/include/ct.hrl").
 
24
 
 
25
%%====================================================================
 
26
%% COMMON TEST CALLBACK FUNCTIONS
 
27
%%====================================================================
 
28
 
 
29
suite() ->
 
30
    [{timetrap,{minutes,1}}].
 
31
 
 
32
groups() ->
 
33
    [
 
34
      {test_group_1a, [testcase_1a,testcase_1b]},
 
35
 
 
36
      {test_group_1b, [], [testcase_1a,testcase_1b]},
 
37
 
 
38
      {test_group_2, [], [testcase_2a,
 
39
 
 
40
                          {test_group_3, [], [testcase_3a,
 
41
                                              testcase_3b]},
 
42
                          testcase_2b]},
 
43
 
 
44
      {test_group_4, [{test_group_5, [], [testcase_5a,
 
45
 
 
46
                                          {group, test_group_6},
 
47
 
 
48
                                          testcase_5b]}]},
 
49
 
 
50
      {test_group_6, [{group, test_group_7}]},
 
51
 
 
52
      {test_group_7, [testcase_7a,testcase_7b]}
 
53
     ].
 
54
 
 
55
all() ->
 
56
    [testcase_1,
 
57
     {group, test_group_1a},
 
58
     {group, test_group_1b},
 
59
     testcase_2,
 
60
     {group, test_group_2},
 
61
     testcase_3,
 
62
     {group, test_group_4}].
 
63
 
 
64
%% this func only for internal test purposes
 
65
grs_and_tcs() ->
 
66
    {[
 
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
 
71
     ],
 
72
     [
 
73
      testcase_1,
 
74
      testcase_1a, testcase_1b,
 
75
      testcase_2,
 
76
      testcase_2a, testcase_2b,
 
77
      testcase_3a, testcase_3b,
 
78
      testcase_3,
 
79
      testcase_5a, testcase_5b,
 
80
      testcase_7a, testcase_7b
 
81
     ]}.
 
82
 
 
83
%%--------------------------------------------------------------------
 
84
%% Suite Configuration
 
85
%%--------------------------------------------------------------------
 
86
 
 
87
init_per_suite(Config) ->
 
88
    [{suite,init}|Config].
 
89
 
 
90
end_per_suite(Config) ->
 
91
    init = ?config(suite,Config).
 
92
 
 
93
%%--------------------------------------------------------------------
 
94
%% Group Configuration
 
95
%%--------------------------------------------------------------------
 
96
 
 
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
 
101
        true ->
 
102
            ct:comment(io_lib:format("~w", [Group])),
 
103
            init = ?config(suite,Config),
 
104
            [{Group,Group} | Config];
 
105
        false ->
 
106
            ct:fail({bad_group,Group})
 
107
    end.
 
108
 
 
109
end_per_group(Group, Config) ->
 
110
    {Grs,_} = grs_and_tcs(),
 
111
    case lists:member(Group, Grs) of
 
112
        true ->
 
113
            init = ?config(suite,Config),
 
114
            Group = ?config(Group,Config),
 
115
            ok;
 
116
        false ->
 
117
            ct:fail({bad_group,Group})
 
118
    end.
 
119
 
 
120
%%--------------------------------------------------------------------
 
121
%% Testcase Configuration
 
122
%%--------------------------------------------------------------------
 
123
 
 
124
init_per_testcase(TestCase, Config) ->
 
125
    {_,TCs} = grs_and_tcs(),
 
126
    case lists:member(TestCase, TCs) of
 
127
        true ->
 
128
            init = ?config(suite,Config),
 
129
            [{TestCase,TestCase} | Config];
 
130
        false ->
 
131
            ct:fail({unknown_testcase,TestCase})
 
132
    end.
 
133
 
 
134
end_per_testcase(TestCase, Config) ->
 
135
    {_,TCs} = grs_and_tcs(),
 
136
    case lists:member(TestCase, TCs) of
 
137
        true ->
 
138
            init = ?config(suite,Config),
 
139
            TestCase = ?config(TestCase,Config),
 
140
            ok;
 
141
        false ->
 
142
            ct:fail({unknown_testcase,TestCase})
 
143
    end.
 
144
 
 
145
 
 
146
%%--------------------------------------------------------------------
 
147
%% Testcases
 
148
%%--------------------------------------------------------------------
 
149
 
 
150
testcase_1() ->
 
151
    [].
 
152
testcase_1(Config) ->
 
153
    init = ?config(suite,Config),
 
154
    testcase_1 = ?config(testcase_1,Config),
 
155
    ok.
 
156
 
 
157
testcase_1a() ->
 
158
    [].
 
159
testcase_1a(Config) ->
 
160
    init = ?config(suite,Config),
 
161
    case ?config(test_group_1a,Config) of
 
162
        test_group_1a -> ok;
 
163
        _ ->
 
164
            case ?config(test_group_1b,Config) of
 
165
                test_group_1b -> ok;
 
166
                _ -> ct:fail(no_group_data)
 
167
            end
 
168
    end,
 
169
    testcase_1a = ?config(testcase_1a,Config),
 
170
    ok.
 
171
testcase_1b() ->
 
172
    [].
 
173
testcase_1b(Config) ->
 
174
    init = ?config(suite,Config),
 
175
    case ?config(test_group_1a,Config) of
 
176
        test_group_1a -> ok;
 
177
        _ ->
 
178
            case ?config(test_group_1b,Config) of
 
179
                test_group_1b -> ok;
 
180
                _ -> ct:fail(no_group_data)
 
181
            end
 
182
    end,
 
183
    undefined = ?config(testcase_1a,Config),
 
184
    testcase_1b = ?config(testcase_1b,Config),
 
185
    ok.
 
186
 
 
187
testcase_2() ->
 
188
    [].
 
189
testcase_2(Config) ->
 
190
    init = ?config(suite,Config),
 
191
    undefined = ?config(test_group_1a,Config),
 
192
    undefined = ?config(test_group_1b,Config),
 
193
    testcase_2 = ?config(testcase_2,Config),
 
194
    ok.
 
195
 
 
196
testcase_2a() ->
 
197
    [].
 
198
testcase_2a(Config) ->
 
199
    init = ?config(suite,Config),
 
200
    test_group_2 = ?config(test_group_2,Config),
 
201
    testcase_2a = ?config(testcase_2a,Config),
 
202
    ok.
 
203
testcase_2b() ->
 
204
    [].
 
205
testcase_2b(Config) ->
 
206
    init = ?config(suite,Config),
 
207
    test_group_2 = ?config(test_group_2,Config),
 
208
    undefined = ?config(testcase_2a,Config),
 
209
    testcase_2b = ?config(testcase_2b,Config),
 
210
    ok.
 
211
 
 
212
testcase_3a() ->
 
213
    [].
 
214
testcase_3a(Config) ->
 
215
    init = ?config(suite,Config),
 
216
    test_group_2 = ?config(test_group_2,Config),
 
217
    test_group_3 = ?config(test_group_3,Config),
 
218
    undefined = ?config(testcase_2b,Config),
 
219
    testcase_3a = ?config(testcase_3a,Config),
 
220
    ok.
 
221
testcase_3b() ->
 
222
    [].
 
223
testcase_3b(Config) ->
 
224
    init = ?config(suite,Config),
 
225
    test_group_2 = ?config(test_group_2,Config),
 
226
    test_group_3 = ?config(test_group_3,Config),
 
227
    undefined = ?config(testcase_3a,Config),
 
228
    testcase_3b = ?config(testcase_3b,Config),
 
229
    ok.
 
230
 
 
231
testcase_3() ->
 
232
    [].
 
233
testcase_3(Config) ->
 
234
    init = ?config(suite,Config),
 
235
    undefined = ?config(test_group_2,Config),
 
236
    undefined = ?config(test_group_3,Config),
 
237
    testcase_3 = ?config(testcase_3,Config),
 
238
    ok.
 
239
 
 
240
testcase_5a() ->
 
241
    [].
 
242
testcase_5a(Config) ->
 
243
    init = ?config(suite,Config),
 
244
    undefined = ?config(test_group_3,Config),
 
245
    test_group_4 = ?config(test_group_4,Config),
 
246
    test_group_5 = ?config(test_group_5,Config),
 
247
    undefined = ?config(testcase_3,Config),
 
248
    testcase_5a = ?config(testcase_5a,Config),
 
249
    ok.
 
250
testcase_5b() ->
 
251
    [].
 
252
testcase_5b(Config) ->
 
253
    init = ?config(suite,Config),
 
254
    test_group_4 = ?config(test_group_4,Config),
 
255
    test_group_5 = ?config(test_group_5,Config),
 
256
    undefined = ?config(testcase_5a,Config),
 
257
    testcase_5b = ?config(testcase_5b,Config),
 
258
    ok.
 
259
 
 
260
testcase_7a() ->
 
261
    [].
 
262
testcase_7a(Config) ->
 
263
    init = ?config(suite,Config),
 
264
    undefined = ?config(test_group_3,Config),
 
265
    test_group_4 = ?config(test_group_4,Config),
 
266
    test_group_5 = ?config(test_group_5,Config),
 
267
    test_group_6 = ?config(test_group_6,Config),
 
268
    test_group_7 = ?config(test_group_7,Config),
 
269
    testcase_7a = ?config(testcase_7a,Config),
 
270
    ok.
 
271
testcase_7b() ->
 
272
    [].
 
273
testcase_7b(Config) ->
 
274
    init = ?config(suite,Config),
 
275
    test_group_4 = ?config(test_group_4,Config),
 
276
    test_group_5 = ?config(test_group_5,Config),
 
277
    test_group_6 = ?config(test_group_6,Config),
 
278
    test_group_7 = ?config(test_group_7,Config),
 
279
    undefined = ?config(testcase_7a,Config),
 
280
    testcase_7b = ?config(testcase_7b,Config),
 
281
    ok.