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

« back to all changes in this revision

Viewing changes to lib/kernel/test/bif_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
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
-module(bif_SUITE).
20
 
-export([all/1]).
 
20
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
21
         init_per_group/2,end_per_group/2]).
21
22
 
22
 
-export([spawn_tests/1, 
 
23
-export([ 
23
24
         spawn1/1, spawn2/1, spawn3/1, spawn4/1,
24
25
 
25
 
         spawn_link_tests/1,
 
26
        
26
27
         spawn_link1/1, spawn_link2/1, spawn_link3/1, spawn_link4/1,
27
28
 
28
 
         spawn_opt_tests/1,
 
29
        
29
30
         spawn_opt2/1, spawn_opt3/1, spawn_opt4/1, spawn_opt5/1,
30
31
 
31
32
         spawn_failures/1,
33
34
         run_fun/1,
34
35
         wilderness/1]).
35
36
 
36
 
-export([init_per_testcase/2, fin_per_testcase/2]).
 
37
-export([init_per_testcase/2, end_per_testcase/2]).
37
38
 
38
 
-include("test_server.hrl").
 
39
-include_lib("test_server/include/test_server.hrl").
39
40
 
40
41
% Default timetrap timeout (set in init_per_testcase).
41
42
-define(default_timeout, ?t:minutes(1)).
43
44
init_per_testcase(_Case, Config) ->
44
45
    ?line Dog = ?t:timetrap(?default_timeout),
45
46
    [{watchdog, Dog} | Config].
46
 
fin_per_testcase(_Case, Config) ->
 
47
end_per_testcase(_Case, Config) ->
47
48
    Dog = ?config(watchdog, Config),
48
49
    test_server:timetrap_cancel(Dog),
49
50
    ok.
50
51
 
51
 
all(suite) ->
52
 
    [spawn_tests, spawn_link_tests, spawn_opt_tests, spawn_failures, wilderness].
53
 
 
54
 
spawn_tests(doc) -> ["Test spawn"];
55
 
spawn_tests(suite) ->
56
 
    [spawn1, spawn2, spawn3, spawn4].
57
 
 
58
 
spawn_link_tests(doc) -> ["Test spawn_link"];
59
 
spawn_link_tests(suite) ->
60
 
    [spawn_link1, spawn_link2, spawn_link3, spawn_link4].
61
 
 
62
 
spawn_opt_tests(doc) -> ["Test spawn_opt"];
63
 
spawn_opt_tests(suite) ->
64
 
    [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5].
 
52
suite() -> [{ct_hooks,[ts_install_cth]}].
 
53
 
 
54
all() -> 
 
55
    [{group, spawn_tests}, {group, spawn_link_tests},
 
56
     {group, spawn_opt_tests}, spawn_failures, wilderness].
 
57
 
 
58
groups() -> 
 
59
    [{spawn_tests, [], [spawn1, spawn2, spawn3, spawn4]},
 
60
     {spawn_link_tests, [],
 
61
      [spawn_link1, spawn_link2, spawn_link3, spawn_link4]},
 
62
     {spawn_opt_tests, [],
 
63
      [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}].
 
64
 
 
65
init_per_suite(Config) ->
 
66
    Config.
 
67
 
 
68
end_per_suite(_Config) ->
 
69
    ok.
 
70
 
 
71
init_per_group(_GroupName, Config) ->
 
72
    Config.
 
73
 
 
74
end_per_group(_GroupName, Config) ->
 
75
    Config.
 
76
 
65
77
 
66
78
spawn1(doc) -> ["Test spawn/1"];
67
79
spawn1(suite) ->
68
80
    [];
69
 
spawn1(Config) when list(Config) ->
 
81
spawn1(Config) when is_list(Config) ->
70
82
    ?line Node = node(),
71
83
    ?line Parent = self(),
72
84
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
83
95
spawn2(doc) -> ["Test spawn/2"];
84
96
spawn2(suite) ->
85
97
    [];
86
 
spawn2(Config) when list(Config) ->
 
98
spawn2(Config) when is_list(Config) ->
87
99
    ?line {ok, Node} = start_node(spawn2),
88
100
 
89
101
    ?line Parent = self(),
105
117
spawn3(doc) -> ["Test spawn/3"];
106
118
spawn3(suite) ->
107
119
    [];
108
 
spawn3(Config) when list(Config) ->
 
120
spawn3(Config) when is_list(Config) ->
109
121
    ?line Node = node(),
110
122
 
111
123
    ?line Parent = self(),
127
139
spawn4(doc) -> ["Test spawn/4"];
128
140
spawn4(suite) ->
129
141
    [];
130
 
spawn4(Config) when list(Config) ->
 
142
spawn4(Config) when is_list(Config) ->
131
143
    ?line {ok, Node} = start_node(spawn4),
132
144
 
133
145
    ?line Parent = self(),
154
166
spawn_link1(doc) -> ["Test spawn_link/1"];
155
167
spawn_link1(suite) ->
156
168
    [];
157
 
spawn_link1(Config) when list(Config) ->
 
169
spawn_link1(Config) when is_list(Config) ->
158
170
    ?line Node = node(),
159
171
    ?line Parent = self(),
160
172
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
171
183
spawn_link2(doc) -> ["Test spawn_link/2"];
172
184
spawn_link2(suite) ->
173
185
    [];
174
 
spawn_link2(Config) when list(Config) ->
 
186
spawn_link2(Config) when is_list(Config) ->
175
187
    ?line {ok, Node} = start_node(spawn_link2),
176
188
 
177
189
    ?line Parent = self(),
192
204
spawn_link3(doc) -> ["Test spawn_link/3"];
193
205
spawn_link3(suite) ->
194
206
    [];
195
 
spawn_link3(Config) when list(Config) ->
 
207
spawn_link3(Config) when is_list(Config) ->
196
208
    ?line Node = node(),
197
209
 
198
210
    ?line Parent = self(),
214
226
spawn_link4(doc) -> ["Test spawn_link/4"];
215
227
spawn_link4(suite) ->
216
228
    [];
217
 
spawn_link4(Config) when list(Config) ->
 
229
spawn_link4(Config) when is_list(Config) ->
218
230
    ?line {ok, Node} = start_node(spawn_link4),
219
231
 
220
232
    ?line Parent = self(),
240
252
spawn_opt2(doc) -> ["Test spawn_opt/2"];
241
253
spawn_opt2(suite) ->
242
254
    [];
243
 
spawn_opt2(Config) when list(Config) ->
 
255
spawn_opt2(Config) when is_list(Config) ->
244
256
    ?line Node = node(),
245
257
    ?line Parent = self(),
246
258
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
275
287
spawn_opt3(doc) -> ["Test spawn_opt/3"];
276
288
spawn_opt3(suite) ->
277
289
    [];
278
 
spawn_opt3(Config) when list(Config) ->
 
290
spawn_opt3(Config) when is_list(Config) ->
279
291
    ?line {ok, Node} = start_node(spawn_opt3),
280
292
    ?line Parent = self(),
281
293
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
312
324
spawn_opt4(doc) -> ["Test spawn_opt/4"];
313
325
spawn_opt4(suite) ->
314
326
    [];
315
 
spawn_opt4(Config) when list(Config) ->
 
327
spawn_opt4(Config) when is_list(Config) ->
316
328
    ?line Node = node(),
317
329
    ?line Parent = self(),
318
330
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
352
364
spawn_opt5(doc) -> ["Test spawn_opt/5"];
353
365
spawn_opt5(suite) ->
354
366
    [];
355
 
spawn_opt5(Config) when list(Config) ->
 
367
spawn_opt5(Config) when is_list(Config) ->
356
368
    ?line {ok, Node} = start_node(spawn_opt5),
357
369
    ?line Parent = self(),
358
370
    ?line {_, _, FA, _} = fetch_proc_vals(self()),
396
408
    ["Test failure behavior of spawn bifs"];
397
409
spawn_failures(suite) ->
398
410
    [];
399
 
spawn_failures(Config) when list(Config) ->
 
411
spawn_failures(Config) when is_list(Config) ->
400
412
    ?line ThisNode = node(),
401
413
    ?line {ok, Node} = start_node(spawn_remote_failure),
402
414
 
556
568
     "wilderness of the heap are interpreted correct by the emulator "];
557
569
wilderness(suite) ->
558
570
    [];
559
 
wilderness(Config) when list(Config) ->
 
571
wilderness(Config) when is_list(Config) ->
560
572
    ?line Dog = ?t:timetrap(?default_timeout),
561
573
    ?line OKParams = {512, 8},
562
574
    ?line Alloc = erlang:system_info(allocator),
604
616
    end,
605
617
    stop_node(Node).
606
618
             
607
 
to_string(X) when integer(X) ->
 
619
to_string(X) when is_integer(X) ->
608
620
    integer_to_list(X);
609
 
to_string(X) when atom(X) ->
 
621
to_string(X) when is_atom(X) ->
610
622
    atom_to_list(X);
611
 
to_string(X) when list(X) ->
 
623
to_string(X) when is_list(X) ->
612
624
    X.
613
625
 
614
626
get_nodenames(N, T) ->