~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/compiler/test/fun_SUITE.erl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
3
%% 
4
 
%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
 
4
%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
5
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
18
18
%%
19
19
-module(fun_SUITE).
20
20
 
21
 
-export([all/1,
22
 
         test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]).
23
 
 
24
 
-include("test_server.hrl").
25
 
 
26
 
all(suite) ->
 
21
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
22
         init_per_group/2,end_per_group/2,
 
23
         test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1,
 
24
         external/1]).
 
25
 
 
26
%% Internal export.
 
27
-export([call_me/1]).
 
28
 
 
29
-include_lib("test_server/include/test_server.hrl").
 
30
 
 
31
suite() -> [{ct_hooks,[ts_install_cth]}].
 
32
 
 
33
all() -> 
27
34
    test_lib:recompile(?MODULE),
28
 
    [test1,overwritten_fun,otp_7202,bif_fun].
 
35
    [test1,overwritten_fun,otp_7202,bif_fun,external].
 
36
 
 
37
groups() -> 
 
38
    [].
 
39
 
 
40
init_per_suite(Config) ->
 
41
    Config.
 
42
 
 
43
end_per_suite(_Config) ->
 
44
    ok.
 
45
 
 
46
init_per_group(_GroupName, Config) ->
 
47
    Config.
 
48
 
 
49
end_per_group(_GroupName, Config) ->
 
50
    Config.
29
51
 
30
52
%%% The help functions below are copied from emulator:bs_construct_SUITE.
31
53
 
133
155
    ?line F = fun abs/1,
134
156
    ?line 5 = F(-5),
135
157
    ok.
 
158
 
 
159
-define(APPLY(M, F, A), (fun(Fun) -> {ok,{a,b}} = Fun({a,b}) end)(fun M:F/A)).
 
160
-define(APPLY2(M, F, A),
 
161
        (fun(Map) ->
 
162
                 Id = fun(I) -> I end,
 
163
                 List = [x,y],
 
164
                 List = Map(Id, List),
 
165
                 {type,external} = erlang:fun_info(Map, type)
 
166
         end)(fun M:F/A)).
136
167
    
 
168
external(Config) when is_list(Config) ->
 
169
    Mod = id(?MODULE),
 
170
    Func = id(call_me),
 
171
    Arity = id(1),
 
172
 
 
173
    ?APPLY(?MODULE, call_me, 1),
 
174
    ?APPLY(?MODULE, call_me, Arity),
 
175
    ?APPLY(?MODULE, Func, 1),
 
176
    ?APPLY(?MODULE, Func, Arity),
 
177
    ?APPLY(Mod, call_me, 1),
 
178
    ?APPLY(Mod, call_me, Arity),
 
179
    ?APPLY(Mod, Func, 1),
 
180
    ?APPLY(Mod, Func, Arity),
 
181
 
 
182
    ListsMod = id(lists),
 
183
    ListsMap = id(map),
 
184
    ListsArity = id(2),
 
185
 
 
186
    ?APPLY2(lists, map, 2),
 
187
    ?APPLY2(lists, map, ListsArity),
 
188
    ?APPLY2(lists, ListsMap, 2),
 
189
    ?APPLY2(lists, ListsMap, ListsArity),
 
190
    ?APPLY2(ListsMod, map, 2),
 
191
    ?APPLY2(ListsMod, map, ListsArity),
 
192
    ?APPLY2(ListsMod, ListsMap, 2),
 
193
    ?APPLY2(ListsMod, ListsMap, ListsArity),
 
194
 
 
195
    ok.
 
196
 
 
197
call_me(I) ->
 
198
    {ok,I}.
 
199
 
 
200
id(I) ->
 
201
    I.