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

« back to all changes in this revision

Viewing changes to lib/stdlib/test/c_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
3
%% 
4
 
%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
 
4
%% Copyright Ericsson AB 1998-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
17
17
%% %CopyrightEnd%
18
18
%%
19
19
-module(c_SUITE).
20
 
-export([all/1]).
21
 
-export([c_1/1, c_2/1, c_3/1, c_4/1, memory/1]).
22
 
 
23
 
-include("test_server.hrl").
24
 
 
25
 
-import(c, [c/2]).
26
 
 
27
 
all(doc) -> ["Test cases for the 'c' module."];
28
 
all(suite) ->
29
 
    [c_1, c_2, c_3, c_4, memory].
 
20
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
21
         init_per_group/2,end_per_group/2]).
 
22
-export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1,
 
23
         memory/1]).
 
24
 
 
25
-include_lib("test_server/include/test_server.hrl").
 
26
 
 
27
-import(c, [c/2, nc/2]).
 
28
 
 
29
suite() -> [{ct_hooks,[ts_install_cth]}].
 
30
 
 
31
all() -> 
 
32
    [c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory].
 
33
 
 
34
groups() -> 
 
35
    [].
 
36
 
 
37
init_per_suite(Config) ->
 
38
    Config.
 
39
 
 
40
end_per_suite(_Config) ->
 
41
    ok.
 
42
 
 
43
init_per_group(_GroupName, Config) ->
 
44
    Config.
 
45
 
 
46
end_per_group(_GroupName, Config) ->
 
47
    Config.
 
48
 
30
49
 
31
50
%%% Write output to a directory other than current directory:
32
51
 
34
53
    ["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
35
54
c_1(suite) ->
36
55
    [];
37
 
c_1(Config) when list(Config) ->
 
56
c_1(Config) when is_list(Config) ->
38
57
    ?line R = filename:join(?config(data_dir, Config), "m.erl"),
39
58
    ?line W = ?config(priv_dir, Config),
40
59
    ?line Result = c(R,[{outdir,W}]),
44
63
    ["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
45
64
c_2(suite) ->
46
65
    [];
47
 
c_2(Config) when list(Config) ->
 
66
c_2(Config) when is_list(Config) ->
48
67
    ?line R = filename:join(?config(data_dir, Config), "m"),
49
68
    ?line W = ?config(priv_dir, Config),
50
69
    ?line Result = c(R,[{outdir,W}]),
59
78
     "directory). [ticket OTP-1209]."];
60
79
c_3(suite) ->
61
80
    [];
62
 
c_3(Config) when list(Config) ->
 
81
c_3(Config) when is_list(Config) ->
63
82
    ?line R = filename:join(?config(data_dir, Config), "m.erl"),
64
83
    ?line W = ?config(priv_dir, Config),
65
84
    ?line file:set_cwd(W),
71
90
     "directory). [ticket OTP-1209]."];
72
91
c_4(suite) ->
73
92
    [];
74
 
c_4(Config) when list(Config) ->
 
93
c_4(Config) when is_list(Config) ->
75
94
    ?line R = filename:join(?config(data_dir, Config), "m"),
76
95
    ?line W = ?config(priv_dir, Config),
77
96
    ?line file:set_cwd(W),
78
97
    ?line Result = c(R,[{outdir,W}]),
79
98
    ?line {ok, m} = Result.
80
99
 
 
100
%%% Write output to a directory other than current directory:
 
101
 
 
102
nc_1(doc) ->
 
103
    ["Checks that c:nc works also with option 'outdir'."];
 
104
nc_1(suite) ->
 
105
    [];
 
106
nc_1(Config) when is_list(Config) ->
 
107
    ?line R = filename:join(?config(data_dir, Config), "m.erl"),
 
108
    ?line W = ?config(priv_dir, Config),
 
109
    ?line Result = nc(R,[{outdir,W}]),
 
110
    ?line {ok, m} = Result.
 
111
 
 
112
nc_2(doc) ->
 
113
    ["Checks that c:nc works also with option 'outdir'."];
 
114
nc_2(suite) ->
 
115
    [];
 
116
nc_2(Config) when is_list(Config) ->
 
117
    ?line R = filename:join(?config(data_dir, Config), "m"),
 
118
    ?line W = ?config(priv_dir, Config),
 
119
    ?line Result = nc(R,[{outdir,W}]),
 
120
    ?line {ok, m} = Result.
 
121
 
 
122
 
 
123
%%% Put results in current directory (or rather, change current dir
 
124
%%% to the output dir):
 
125
 
 
126
nc_3(doc) ->
 
127
    ["Checks that c:nc works also with option 'outdir' (same as current"
 
128
     "directory)."];
 
129
nc_3(suite) ->
 
130
    [];
 
131
nc_3(Config) when is_list(Config) ->
 
132
    ?line R = filename:join(?config(data_dir, Config), "m.erl"),
 
133
    ?line W = ?config(priv_dir, Config),
 
134
    ?line file:set_cwd(W),
 
135
    ?line Result = nc(R,[{outdir,W}]),
 
136
    ?line {ok, m} = Result.
 
137
 
 
138
nc_4(doc) ->
 
139
    ["Checks that c:nc works also with option 'outdir' (same as current"
 
140
     "directory)."];
 
141
nc_4(suite) ->
 
142
    [];
 
143
nc_4(Config) when is_list(Config) ->
 
144
    ?line R = filename:join(?config(data_dir, Config), "m"),
 
145
    ?line W = ?config(priv_dir, Config),
 
146
    ?line file:set_cwd(W),
 
147
    ?line Result = nc(R,[{outdir,W}]),
 
148
    ?line {ok, m} = Result.
 
149
 
81
150
memory(doc) ->
82
151
    ["Checks that c:memory/[0,1] returns consistent results."];
83
152
memory(suite) ->
84
153
    [];
85
 
memory(Config) when list(Config) ->
 
154
memory(Config) when is_list(Config) ->
86
155
    try
87
156
        ?line ML = c:memory(),
88
157
        ?line T =  mget(total, ML),
112
181
    ?line test_v(V).
113
182
 
114
183
% Help function for c_SUITE:memory/1    
115
 
test_v(V) when integer(V) ->
 
184
test_v(V) when is_integer(V) ->
116
185
    ?line V.