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

« back to all changes in this revision

Viewing changes to erts/emulator/test/process_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 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-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
 
25
25
%%      process_info/1,2
26
26
%%      register/2 (partially)
27
27
 
28
 
-include("test_server.hrl").
 
28
-include_lib("test_server/include/test_server.hrl").
29
29
 
30
30
-define(heap_binary_size, 64).
31
31
 
32
 
-export([all/1, spawn_with_binaries/1,
33
 
         t_exit_1/1, t_exit_2/1, t_exit_2_other/1, t_exit_2_other_normal/1,
 
32
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
33
         init_per_group/2,end_per_group/2, spawn_with_binaries/1,
 
34
         t_exit_1/1, t_exit_2_other/1, t_exit_2_other_normal/1,
34
35
         self_exit/1, normal_suicide_exit/1, abnormal_suicide_exit/1,
35
36
         t_exit_2_catch/1, trap_exit_badarg/1, trap_exit_badarg_in_bif/1,
36
37
         exit_and_timeout/1, exit_twice/1,
41
42
         bump_reductions/1, low_prio/1, binary_owner/1, yield/1, yield2/1,
42
43
         process_status_exiting/1,
43
44
         otp_4725/1, bad_register/1, garbage_collect/1, otp_6237/1,
44
 
         process_info_messages/1, process_flag_badarg/1,
 
45
         process_info_messages/1, process_flag_badarg/1, process_flag_heap_size/1,
 
46
         spawn_opt_heap_size/1,
45
47
         processes_large_tab/1, processes_default_tab/1, processes_small_tab/1,
46
48
         processes_this_tab/1, processes_apply_trap/1,
47
49
         processes_last_call_trap/1, processes_gc_trap/1,
48
 
         processes_term_proc_list/1, processes_bif/1,
49
 
         otp_7738/1, otp_7738_waiting/1, otp_7738_suspended/1,
 
50
         processes_term_proc_list/1,
 
51
         otp_7738_waiting/1, otp_7738_suspended/1,
50
52
         otp_7738_resume/1]).
51
53
-export([prio_server/2, prio_client/2]).
52
54
 
53
 
-export([init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]).
 
55
-export([init_per_testcase/2, end_per_testcase/2]).
54
56
 
55
57
-export([hangaround/2, processes_bif_test/0, do_processes/1,
56
58
         processes_term_proc_list_test/1]).
57
59
 
58
 
all(suite) ->
59
 
    [spawn_with_binaries, t_exit_1, t_exit_2,
 
60
suite() -> [{ct_hooks,[ts_install_cth]}].
 
61
 
 
62
all() -> 
 
63
    [spawn_with_binaries, t_exit_1, {group, t_exit_2},
60
64
     trap_exit_badarg, trap_exit_badarg_in_bif,
61
 
     t_process_info, process_info_other_msg, process_info_other_dist_msg,
62
 
     process_info_2_list,
63
 
     process_info_lock_reschedule, process_info_lock_reschedule2,
64
 
     process_status_exiting,
65
 
     bump_reductions, low_prio, yield, yield2, otp_4725, bad_register,
66
 
     garbage_collect, process_info_messages, process_flag_badarg, otp_6237,
67
 
     processes_bif,
68
 
     otp_7738].
 
65
     t_process_info, process_info_other_msg,
 
66
     process_info_other_dist_msg, process_info_2_list,
 
67
     process_info_lock_reschedule,
 
68
     process_info_lock_reschedule2, process_status_exiting,
 
69
     bump_reductions, low_prio, yield, yield2, otp_4725,
 
70
     bad_register, garbage_collect, process_info_messages,
 
71
     process_flag_badarg, process_flag_heap_size,
 
72
     spawn_opt_heap_size, otp_6237, {group, processes_bif},
 
73
     {group, otp_7738}].
 
74
 
 
75
groups() -> 
 
76
    [{t_exit_2, [],
 
77
      [t_exit_2_other, t_exit_2_other_normal, self_exit,
 
78
       normal_suicide_exit, abnormal_suicide_exit,
 
79
       t_exit_2_catch, exit_and_timeout, exit_twice]},
 
80
     {processes_bif, [],
 
81
      [processes_large_tab, processes_default_tab,
 
82
       processes_small_tab, processes_this_tab,
 
83
       processes_last_call_trap, processes_apply_trap,
 
84
       processes_gc_trap, processes_term_proc_list]},
 
85
     {otp_7738, [],
 
86
      [otp_7738_waiting, otp_7738_suspended,
 
87
       otp_7738_resume]}].
 
88
 
 
89
init_per_suite(Config) ->
 
90
    Config.
 
91
 
 
92
end_per_suite(Config) ->
 
93
    catch erts_debug:set_internal_state(available_internal_state, false),
 
94
    Config.
 
95
 
 
96
init_per_group(_GroupName, Config) ->
 
97
    Config.
 
98
 
 
99
end_per_group(_GroupName, Config) ->
 
100
    Config.
 
101
 
69
102
 
70
103
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
71
104
    Dog=?t:timetrap(?t:minutes(10)),
72
105
    [{watchdog, Dog},{testcase, Func}|Config].
73
106
 
74
 
fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
 
107
end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
75
108
    Dog=?config(watchdog, Config),
76
109
    ?t:timetrap_cancel(Dog).
77
110
 
78
 
end_per_suite(Config) ->
79
 
    catch erts_debug:set_internal_state(available_internal_state, false),
80
 
    Config.
81
 
 
82
111
fun_spawn(Fun) ->
83
112
    spawn_link(erlang, apply, [Fun, []]).
84
113
 
117
146
              {'EXIT', Pid, Garbage} -> ok
118
147
          end.
119
148
 
120
 
t_exit_2(suite) -> [t_exit_2_other, t_exit_2_other_normal, 
121
 
                    self_exit, normal_suicide_exit,
122
 
                    abnormal_suicide_exit, t_exit_2_catch,
123
 
                    exit_and_timeout, exit_twice].
124
149
 
125
150
%% Tests exit/2 with a lot of data in the exit message.
126
151
t_exit_2_other(Config) when is_list(Config) ->
388
413
    ?line register(my_name, self()),
389
414
    ?line {registered_name, my_name} = process_info(self(), registered_name),
390
415
    ?line {status, running} = process_info(self(), status),
 
416
    ?line {min_heap_size, 233} = process_info(self(), min_heap_size),
 
417
    ?line {min_bin_vheap_size, 46368} = process_info(self(), min_bin_vheap_size),
391
418
    ?line {current_function, {?MODULE, t_process_info, 1}} =
392
419
        process_info(self(), current_function),
393
420
    ?line Gleader = group_leader(),
437
464
              empty -> ok
438
465
          end,
439
466
    ?line {messages,[]} = process_info(Pid, messages),
 
467
 
 
468
    ?line {min_heap_size, 233} = process_info(Pid, min_heap_size),
 
469
    ?line {min_bin_vheap_size, 46368} = process_info(Pid, min_bin_vheap_size),
 
470
 
440
471
    ?line Pid ! stop,
441
472
    ok.
442
473
 
1148
1179
    ?line chk_badarg(fun () -> process_flag(trap_exit, gurka) end),
1149
1180
    ?line chk_badarg(fun () -> process_flag(error_handler, 1) end),
1150
1181
    ?line chk_badarg(fun () -> process_flag(min_heap_size, gurka) end),
 
1182
    ?line chk_badarg(fun () -> process_flag(min_bin_vheap_size, gurka) end),
 
1183
    ?line chk_badarg(fun () -> process_flag(min_bin_vheap_size, -1) end),
1151
1184
    ?line chk_badarg(fun () -> process_flag(priority, 4711) end),
1152
1185
    ?line chk_badarg(fun () -> process_flag(save_calls, hmmm) end),
1153
1186
    ?line P= spawn_link(fun () -> receive die -> ok end end),
1219
1252
    otp_6237_select_loop().
1220
1253
 
1221
1254
 
1222
 
processes_bif(doc) ->
1223
 
    [];
1224
 
processes_bif(suite) ->
1225
 
    [processes_large_tab,
1226
 
     processes_default_tab,
1227
 
     processes_small_tab,
1228
 
     processes_this_tab,
1229
 
     processes_last_call_trap,
1230
 
     processes_apply_trap,
1231
 
     processes_gc_trap,
1232
 
     processes_term_proc_list].
1233
1255
 
1234
1256
-define(NoTestProcs, 10000).
1235
1257
-record(processes_bif_info, {min_start_reds,
1774
1796
    ?line exit(Suspendee, bang),
1775
1797
    ?line ok.
1776
1798
 
 
1799
process_flag_heap_size(doc) ->
 
1800
    [];
 
1801
process_flag_heap_size(suite) ->
 
1802
    [];
 
1803
process_flag_heap_size(Config) when is_list(Config) ->
 
1804
    HSize  = 2584,   % must be gc fib number
 
1805
    VHSize = 317811, % must be gc fib number
 
1806
    ?line OldHmin = erlang:process_flag(min_heap_size, HSize),
 
1807
    ?line {min_heap_size, HSize} = erlang:process_info(self(), min_heap_size),
 
1808
    ?line OldVHmin = erlang:process_flag(min_bin_vheap_size, VHSize),
 
1809
    ?line {min_bin_vheap_size, VHSize} = erlang:process_info(self(), min_bin_vheap_size),
 
1810
    ?line HSize = erlang:process_flag(min_heap_size, OldHmin),
 
1811
    ?line VHSize = erlang:process_flag(min_bin_vheap_size, OldVHmin),
 
1812
    ?line ok.
 
1813
 
 
1814
spawn_opt_heap_size(doc) ->
 
1815
    [];
 
1816
spawn_opt_heap_size(suite) ->
 
1817
    [];
 
1818
spawn_opt_heap_size(Config) when is_list(Config) ->
 
1819
    HSize  = 987,   % must be gc fib number
 
1820
    VHSize = 46368, % must be gc fib number
 
1821
    ?line Pid  = spawn_opt(fun () -> receive stop -> ok end end,
 
1822
        [{min_heap_size, HSize},{ min_bin_vheap_size, VHSize}]),
 
1823
    ?line {min_heap_size, HSize} = process_info(Pid, min_heap_size),
 
1824
    ?line {min_bin_vheap_size, VHSize} = process_info(Pid, min_bin_vheap_size),
 
1825
    ?line Pid ! stop,
 
1826
    ?line ok.
1777
1827
 
1778
1828
processes_term_proc_list(doc) ->
1779
1829
    [];
1929
1979
    ?line erlang:system_flag(multi_scheduling, unblock),
1930
1980
    ?line as_expected.
1931
1981
 
1932
 
otp_7738(doc) ->
1933
 
    [];
1934
 
otp_7738(suite) ->
1935
 
    [otp_7738_waiting, otp_7738_suspended, otp_7738_resume].
1936
1982
 
1937
1983
otp_7738_waiting(doc) ->
1938
1984
    [];