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

« back to all changes in this revision

Viewing changes to lib/wx/test/wx_xtra_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 2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2009-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
%%% File    : wx_basic_SUITE.erl
23
23
%%% Created :  3 Nov 2008 by Dan Gudmundsson <dan.gudmundsson@ericsson.com>
24
24
%%%-------------------------------------------------------------------
25
25
-module(wx_xtra_SUITE).
26
 
-export([all/0, init_per_suite/1, end_per_suite/1, 
27
 
         init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]).
 
26
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, 
 
27
         init_per_suite/1, end_per_suite/1, 
 
28
         init_per_testcase/2, end_per_testcase/2]).
28
29
 
29
30
-compile(export_all).
30
31
 
41
42
    wx_test_lib:init_per_testcase(Func,Config).
42
43
end_per_testcase(Func,Config) -> 
43
44
    wx_test_lib:end_per_testcase(Func,Config).
44
 
fin_per_testcase(Func,Config) -> %% For test_server
45
 
    wx_test_lib:end_per_testcase(Func,Config).
46
45
 
47
46
%% SUITE specification
48
 
all() ->
49
 
    all(suite).
50
 
all(suite) ->
51
 
    [
52
 
     destroy_app,
53
 
     multiple_add_in_sizer,
54
 
     app_dies
55
 
    ].
 
47
suite() -> [{ct_hooks,[ts_install_cth]}].
 
48
 
 
49
all() -> 
 
50
    [destroy_app, multiple_add_in_sizer, app_dies,
 
51
     menu_item_debug].
 
52
 
 
53
groups() -> 
 
54
    [].
 
55
 
 
56
init_per_group(_GroupName, Config) ->
 
57
    Config.
 
58
 
 
59
end_per_group(_GroupName, Config) ->
 
60
    Config.
 
61
 
56
62
 
57
63
%% The test cases
58
64
 
68
74
    Wx = ?mr(wx_ref, wx:new()),    
69
75
    Frame = wxFrame:new(Wx, 1, "Destroy"),
70
76
    ?m(ok, wxFrame:destroy(Frame)),
71
 
    wx:destroy(),
72
77
    receive 
73
78
        Msg -> Msg
74
 
    after 150 -> destroy_app_test(N-1)
 
79
    after 150 -> 
 
80
            wx:destroy(),
 
81
            destroy_app_test(N-1)
75
82
    end;
76
83
destroy_app_test(_) -> 
77
84
    receive 
174
181
    wxWindow:show(Frame),
175
182
    wx_test_lib:wx_destroy(Frame, Config).
176
183
 
 
184
menu_item_debug(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo);
 
185
menu_item_debug(Config) ->
 
186
    %% Debugging a menu entry problem
 
187
    %% Run it with: lists:map(fun(_) -> [{0,{ok,_,_}}] = wxt:t() end, lists:seq(1,50)), ok.
 
188
    Wx = wx:new(),
 
189
    wx:debug(trace),
 
190
    Frame = wxFrame:new(Wx, -1, "Button Fix"),
 
191
    wxFrame:connect(Frame, close_window),
 
192
 
 
193
    wxPanel:new(Frame),
 
194
    create_menus(Frame),
 
195
    wxWindow:show(Frame),
 
196
    wx_test_lib:wx_destroy(Frame,Config).
 
197
 
 
198
 
 
199
create_menus(Frame) ->
 
200
    MenuBar = ?mt(wxMenuBar, wxMenuBar:new()),
 
201
    File    = ?mt(wxMenu, wxMenu:new([])),
 
202
    Help    = ?mt(wxMenu, wxMenu:new([])),
 
203
 
 
204
    ?mt(wxMenuItem, wxMenu:append(Help, ?wxID_ABOUT, "&About", [])),
 
205
    ?mt(wxMenuItem, wxMenu:append(Help, ?wxID_HELP, "&Help", [])),
 
206
    ?mt(wxMenuItem, wxMenu:append(File, ?wxID_EXIT, "Exit", [])),
 
207
    T1    = ?mt(wxMenu, wxMenu:new([])),
 
208
    [wxMenuItem:getId(wxMenu:append(T1, Id, integer_to_list(Id), []))
 
209
     || Id <- lists:seq(100, 120)],
 
210
    T2    = ?mt(wxMenu, wxMenu:new([])),
 
211
    [wxMenuItem:getId(wxMenu:append(T2, Id, integer_to_list(Id), []))
 
212
     || Id <- lists:seq(200, 220)],
 
213
    T3    = ?mt(wxMenu, wxMenu:new([])),
 
214
    [wxMenuItem:getId(wxMenu:append(T3, Id, integer_to_list(Id), []))
 
215
     || Id <- lists:seq(300, 320)],
 
216
    T4    = ?mt(wxMenu, wxMenu:new([])),
 
217
    [wxMenuItem:getId(wxMenu:append(T4, Id, integer_to_list(Id), []))
 
218
     || Id <- lists:seq(400, 420)],
 
219
    T5    = ?mt(wxMenu, wxMenu:new([])),
 
220
    [wxMenuItem:getId(wxMenu:append(T5, Id, integer_to_list(Id), []))
 
221
     || Id <- lists:seq(500, 520)],
 
222
    T6    = ?mt(wxMenu, wxMenu:new([])),
 
223
    [wxMenuItem:getId(wxMenu:append(T6, Id, integer_to_list(Id), []))
 
224
     || Id <- lists:seq(600, 620)],
 
225
 
 
226
    ?m(ok,wxFrame:connect(Frame, command_menu_selected)),
 
227
    ?m(true, wxMenuBar:append(MenuBar, File, "&File")),
 
228
    ?m(true, wxMenuBar:append(MenuBar, Help, "&Help")),
 
229
    ?m(true, wxMenuBar:append(MenuBar, T1, "T1")),
 
230
    ?m(true, wxMenuBar:append(MenuBar, T2, "T2")),
 
231
    ?m(true, wxMenuBar:append(MenuBar, T3, "T3")),
 
232
    ?m(true, wxMenuBar:append(MenuBar, T4, "T4")),
 
233
    ?m(true, wxMenuBar:append(MenuBar, T5, "T5")),
 
234
    ?m(true, wxMenuBar:append(MenuBar, T6, "T6")),
 
235
 
 
236
 
 
237
    ?m(ok, wxFrame:setMenuBar(Frame,MenuBar)).