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

« back to all changes in this revision

Viewing changes to erts/test/ethread_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 2004-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2004-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
 
31
31
 
32
32
-define(DEFAULT_TIMEOUT, ?t:minutes(10)).
33
33
 
34
 
-export([all/1, init_per_testcase/2, fin_per_testcase/2]).
 
34
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
35
         init_per_group/2,end_per_group/2, 
 
36
         init_per_testcase/2, fin_per_testcase/2]).
35
37
 
36
38
-export([create_join_thread/1,
37
39
         equal_tids/1,
38
40
         mutex/1,
39
41
         try_lock_mutex/1,
40
 
         recursive_mutex/1,
41
 
         time_now/1,
42
42
         cond_wait/1,
43
 
         cond_timedwait/1,
44
43
         broadcast/1,
45
44
         detached_thread/1,
46
45
         max_threads/1,
47
 
         forksafety/1,
48
 
         vfork/1,
49
46
         tsd/1,
50
47
         spinlock/1,
51
48
         rwspinlock/1,
52
49
         rwmutex/1,
53
 
         atomic/1,
54
 
         gate/1]).
55
 
 
56
 
-include("test_server.hrl").
57
 
 
58
 
tests() ->
59
 
    [create_join_thread,
60
 
     equal_tids,
61
 
     mutex,
62
 
     try_lock_mutex,
63
 
     recursive_mutex,
64
 
     time_now,
65
 
     cond_wait,
66
 
     cond_timedwait,
67
 
     broadcast,
68
 
     detached_thread,
69
 
     max_threads,
70
 
     forksafety,
71
 
     vfork,
72
 
     tsd,
73
 
     spinlock,
74
 
     rwspinlock,
75
 
     rwmutex,
76
 
     atomic,
77
 
     gate].
78
 
 
79
 
all(doc) -> [];
80
 
all(suite) -> tests().
81
 
 
 
50
         atomic/1]).
 
51
 
 
52
-include_lib("test_server/include/test_server.hrl").
 
53
 
 
54
tests() -> 
 
55
    [create_join_thread, equal_tids, mutex, try_lock_mutex,
 
56
     cond_wait, broadcast, detached_thread,
 
57
     max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic].
 
58
 
 
59
suite() -> [{ct_hooks,[ts_install_cth]}].
 
60
 
 
61
all() -> 
 
62
    tests().
 
63
 
 
64
groups() -> 
 
65
    [].
 
66
 
 
67
init_per_suite(Config) ->
 
68
    Config.
 
69
 
 
70
end_per_suite(_Config) ->
 
71
    ok.
 
72
 
 
73
init_per_group(_GroupName, Config) ->
 
74
    Config.
 
75
 
 
76
end_per_group(_GroupName, Config) ->
 
77
    Config.
82
78
 
83
79
%%
84
80
%%
114
110
try_lock_mutex(Config) ->
115
111
    run_case(Config, "try_lock_mutex", "").
116
112
 
117
 
recursive_mutex(doc) ->
118
 
    ["Tests recursive mutexes."];
119
 
recursive_mutex(suite) ->
120
 
    [];
121
 
recursive_mutex(Config) ->
122
 
    run_case(Config, "recursive_mutex", "").
123
 
 
124
 
time_now(doc) ->
125
 
    ["Tests ethr_time_now by comparing time values with Erlang."];
126
 
time_now(suite) ->
127
 
    [];
128
 
time_now(Config) ->
129
 
    run_case(Config, "time_now", "", fun (P) ->
130
 
                                             spawn_link(fun () ->
131
 
                                                                watchdog(P)
132
 
                                                        end)
133
 
                                     end).
134
 
 
135
113
wd_dispatch(P) ->
136
114
    receive
137
115
        bye ->
169
147
cond_wait(Config) ->
170
148
    run_case(Config, "cond_wait", "").
171
149
 
172
 
cond_timedwait(doc) ->
173
 
    ["Tests ethr_cond_timedwait with ethr_cond_signal and ethr_cond_broadcast."];
174
 
cond_timedwait(suite) ->
175
 
    [];
176
 
cond_timedwait(Config) ->
177
 
    run_case(Config, "cond_timedwait", "").
178
 
 
179
150
broadcast(doc) ->
180
151
    ["Tests that a ethr_cond_broadcast really wakes up all waiting threads"];
181
152
broadcast(suite) ->
195
166
max_threads(suite) ->
196
167
    [];
197
168
max_threads(Config) ->
198
 
    run_case(Config, "max_threads", "").
199
 
 
200
 
forksafety(doc) ->
201
 
    ["Tests forksafety."];
202
 
forksafety(suite) ->
203
 
    [];
204
 
forksafety(Config) ->
205
 
    run_case(Config, "forksafety", "").
206
 
 
207
 
vfork(doc) ->
208
 
    ["Tests vfork with threads."];
209
 
vfork(suite) ->
210
 
    case ?t:os_type() of
211
 
        {unix, osf1} ->
212
 
            {skip, "vfork() known to hang multi-threaded applications on osf1"};
 
169
    case {os:type(), os:version()} of
 
170
        {{unix,darwin}, {9, _, _}} ->
 
171
            %% For some reason pthread_create() crashes when more
 
172
            %% threads cannot be created, instead of returning an
 
173
            %% error code on our MacOS X Leopard machine...
 
174
            {skipped, "MacOS X Leopard cannot cope with this test..."};
213
175
        _ ->
214
 
            []
215
 
    end;
216
 
vfork(Config) ->
217
 
    run_case(Config, "vfork", "").
 
176
            run_case(Config, "max_threads", "")
 
177
    end.
218
178
 
219
179
tsd(doc) ->
220
180
    ["Tests thread specific data."];
251
211
atomic(Config) ->
252
212
    run_case(Config, "atomic", "").
253
213
 
254
 
gate(doc) ->
255
 
    ["Tests gates."];
256
 
gate(suite) ->
257
 
    [];
258
 
gate(Config) ->
259
 
    run_case(Config, "gate", "").
260
 
 
261
214
%%
262
215
%%
263
216
%% Auxiliary functions