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

« back to all changes in this revision

Viewing changes to erts/emulator/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 1999-2010. All Rights Reserved.
 
4
%% Copyright Ericsson AB 1999-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
22
22
 
23
23
-define(default_timeout, ?t:minutes(1)).
24
24
 
25
 
-export([all/1,init_per_testcase/2,fin_per_testcase/2,
 
25
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
26
         init_per_group/2,end_per_group/2,
 
27
         init_per_testcase/2,end_per_testcase/2,
26
28
         bad_apply/1,bad_fun_call/1,badarity/1,ext_badarity/1,
27
29
         equality/1,ordering/1,
28
30
         fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1,
32
34
 
33
35
-export([nothing/0]).
34
36
 
35
 
-include("test_server.hrl").
36
 
 
37
 
all(suite) ->
38
 
    [bad_apply,bad_fun_call,badarity,ext_badarity,equality,ordering,
39
 
     fun_to_port,t_hash,t_phash,t_phash2,md5,
40
 
     refc,refc_ets,refc_dist,const_propagation,
41
 
     t_arity,t_is_function2,t_fun_info].
 
37
-include_lib("test_server/include/test_server.hrl").
 
38
 
 
39
suite() -> [{ct_hooks,[ts_install_cth]}].
 
40
 
 
41
all() -> 
 
42
    [bad_apply, bad_fun_call, badarity, ext_badarity,
 
43
     equality, ordering, fun_to_port, t_hash, t_phash,
 
44
     t_phash2, md5, refc, refc_ets, refc_dist,
 
45
     const_propagation, t_arity, t_is_function2, t_fun_info].
 
46
 
 
47
groups() -> 
 
48
    [].
 
49
 
 
50
init_per_suite(Config) ->
 
51
    Config.
 
52
 
 
53
end_per_suite(_Config) ->
 
54
    ok.
 
55
 
 
56
init_per_group(_GroupName, Config) ->
 
57
    Config.
 
58
 
 
59
end_per_group(_GroupName, Config) ->
 
60
    Config.
 
61
 
42
62
 
43
63
init_per_testcase(_Case, Config) ->
44
64
    ?line Dog = test_server:timetrap(?default_timeout),
45
65
    [{watchdog, Dog}|Config].
46
66
 
47
 
fin_per_testcase(_Case, Config) ->
 
67
end_per_testcase(_Case, Config) ->
48
68
    Dog=?config(watchdog, Config),
49
69
    test_server:timetrap_cancel(Dog),
50
70
    ok.
627
647
    %% Fun is passed in an exit signal. Wait until it is gone.
628
648
    ?line wait_until(fun () -> 4 =/= fun_refc(F2) end),
629
649
    ?line 3 = fun_refc(F2),
630
 
    erts_debug:set_internal_state(available_internal_state, true),
631
 
    ?line F_refc = case erts_debug:get_internal_state(force_heap_frags) of
632
 
                       false -> 3;
633
 
                       true -> 2 % GC after bif already decreased it
634
 
                   end,
635
 
    ?line F_refc = fun_refc(F),
636
 
    erts_debug:set_internal_state(available_internal_state, false),
 
650
    ?line true = erlang:garbage_collect(),
 
651
    ?line 2 = fun_refc(F),
637
652
    refc_dist_send(Node, F).
638
653
 
639
654
refc_dist_send(Node, F) ->
640
 
    ?line true = erlang:garbage_collect(),
641
655
    ?line Pid = spawn_link(Node,
642
656
                           fun() -> receive
643
657
                                        {To,Fun} when is_function(Fun) ->