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

« back to all changes in this revision

Viewing changes to lib/common_test/test/ct_groups_test_1_SUITE_data/groups_2/test/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 2009-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
            init = ?config(suite,Config),
 
103
            [{Group,Group} | Config];
 
104
        false ->
 
105
            ct:fail({bad_group,Group})
 
106
    end.
 
107
 
 
108
end_per_group(Group, Config) ->
 
109
    {Grs,_} = grs_and_tcs(),
 
110
    case lists:member(Group, Grs) of
 
111
        true ->
 
112
            init = ?config(suite,Config),
 
113
            Group = ?config(Group,Config),
 
114
            ok;
 
115
        false ->
 
116
            ct:fail({bad_group,Group})
 
117
    end.
 
118
 
 
119
%%--------------------------------------------------------------------
 
120
%% Testcase Configuration
 
121
%%--------------------------------------------------------------------
 
122
 
 
123
init_per_testcase(TestCase, Config) ->
 
124
    {_,TCs} = grs_and_tcs(),
 
125
    case lists:member(TestCase, TCs) of
 
126
        true ->     
 
127
            init = ?config(suite,Config),
 
128
            [{TestCase,TestCase} | Config];
 
129
        false ->
 
130
            ct:fail({unknown_testcase,TestCase})
 
131
    end.
 
132
 
 
133
end_per_testcase(TestCase, Config) ->
 
134
    {_,TCs} = grs_and_tcs(),
 
135
    case lists:member(TestCase, TCs) of
 
136
        true ->     
 
137
            init = ?config(suite,Config),
 
138
            TestCase = ?config(TestCase,Config),
 
139
            ok;
 
140
        false ->
 
141
            ct:fail({unknown_testcase,TestCase})
 
142
    end.
 
143
 
 
144
 
 
145
%%--------------------------------------------------------------------
 
146
%% Testcases
 
147
%%--------------------------------------------------------------------
 
148
 
 
149
testcase_1() -> 
 
150
    [].
 
151
testcase_1(Config) ->   
 
152
    init = ?config(suite,Config),
 
153
    testcase_1 = ?config(testcase_1,Config),
 
154
    ok.
 
155
 
 
156
testcase_1a() -> 
 
157
    [].
 
158
testcase_1a(Config) ->
 
159
    init = ?config(suite,Config),
 
160
    case ?config(test_group_1a,Config) of
 
161
        test_group_1a -> ok;
 
162
        _ ->     
 
163
            case ?config(test_group_1b,Config) of
 
164
                test_group_1b -> ok;
 
165
                _ -> ct:fail(no_group_data)
 
166
            end
 
167
    end,
 
168
    testcase_1a = ?config(testcase_1a,Config),
 
169
    ok.
 
170
testcase_1b() -> 
 
171
    [].
 
172
testcase_1b(Config) ->
 
173
    init = ?config(suite,Config),
 
174
    case ?config(test_group_1a,Config) of
 
175
        test_group_1a -> ok;
 
176
        _ ->     
 
177
            case ?config(test_group_1b,Config) of
 
178
                test_group_1b -> ok;
 
179
                _ -> ct:fail(no_group_data)
 
180
            end
 
181
    end,
 
182
    undefined = ?config(testcase_1a,Config),
 
183
    testcase_1b = ?config(testcase_1b,Config),
 
184
    ok.
 
185
 
 
186
testcase_2() -> 
 
187
    [].
 
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),
 
193
    ok.
 
194
 
 
195
testcase_2a() -> 
 
196
    [].
 
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),
 
201
    ok.
 
202
testcase_2b() -> 
 
203
    [].
 
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),
 
209
    ok.
 
210
 
 
211
testcase_3a() -> 
 
212
    [].
 
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),
 
219
    ok.
 
220
testcase_3b() -> 
 
221
    [].
 
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),
 
228
    ok.
 
229
 
 
230
testcase_3() -> 
 
231
    [].
 
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),
 
237
    ok.
 
238
 
 
239
testcase_5a() -> 
 
240
    [].
 
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),
 
248
    ok.
 
249
testcase_5b() -> 
 
250
    [].
 
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),
 
257
    ok.
 
258
 
 
259
testcase_7a() -> 
 
260
    [].
 
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),
 
269
    ok.
 
270
testcase_7b() -> 
 
271
    [].
 
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),
 
280
    ok.