4
%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
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
19
19
-module(fun_SUITE).
22
test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]).
24
-include("test_server.hrl").
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,
29
-include_lib("test_server/include/test_server.hrl").
31
suite() -> [{ct_hooks,[ts_install_cth]}].
27
34
test_lib:recompile(?MODULE),
28
[test1,overwritten_fun,otp_7202,bif_fun].
35
[test1,overwritten_fun,otp_7202,bif_fun,external].
40
init_per_suite(Config) ->
43
end_per_suite(_Config) ->
46
init_per_group(_GroupName, Config) ->
49
end_per_group(_GroupName, Config) ->
30
52
%%% The help functions below are copied from emulator:bs_construct_SUITE.
133
155
?line F = fun abs/1,
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),
162
Id = fun(I) -> I end,
164
List = Map(Id, List),
165
{type,external} = erlang:fun_info(Map, type)
168
external(Config) when is_list(Config) ->
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),
182
ListsMod = id(lists),
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),