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

« back to all changes in this revision

Viewing changes to erts/test/erlc_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 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-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
-module(erlc_SUITE).
20
20
 
21
21
%% Tests the erlc command by compiling various types of files.
22
22
 
23
 
-export([all/1, compile_erl/1, compile_yecc/1, compile_script/1,
24
 
         compile_mib/1, good_citizen/1, deep_cwd/1]).
25
 
 
26
 
-include("test_server.hrl").
27
 
 
28
 
all(suite) ->
 
23
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
24
         init_per_group/2,end_per_group/2, compile_erl/1,
 
25
         compile_yecc/1, compile_script/1,
 
26
         compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]).
 
27
 
 
28
-include_lib("test_server/include/test_server.hrl").
 
29
 
 
30
suite() -> [{ct_hooks,[ts_install_cth]}].
 
31
 
 
32
all() -> 
29
33
    [compile_erl, compile_yecc, compile_script, compile_mib,
30
 
     good_citizen, deep_cwd].
 
34
     good_citizen, deep_cwd, arg_overflow].
 
35
 
 
36
groups() -> 
 
37
    [].
 
38
 
 
39
init_per_suite(Config) ->
 
40
    Config.
 
41
 
 
42
end_per_suite(_Config) ->
 
43
    ok.
 
44
 
 
45
init_per_group(_GroupName, Config) ->
 
46
    Config.
 
47
 
 
48
end_per_group(_GroupName, Config) ->
 
49
    Config.
31
50
 
32
51
%% Copy from erlc_SUITE_data/include/erl_test.hrl.
33
52
 
56
75
 
57
76
    ?line run(Config, Cmd, FileName, "-W0", ["_OK_"]),
58
77
 
 
78
    %% Try treating warnings as errors.
 
79
 
 
80
    ?line run(Config, Cmd, FileName, "-Werror",
 
81
              ["compile: warnings being treated as errors\$",
 
82
               "Warning: function foo/0 is unused\$",
 
83
               "_ERROR_"]),
 
84
 
59
85
    %% Check a bad file.
60
86
 
61
87
    ?line BadFile = filename:join(SrcDir, "erl_test_bad.erl"),
117
143
    ?line case test_server:os_type() of
118
144
              {unix,_} ->
119
145
                  ?line run(Config, Cmd, FileName, "-W +'{verbosity,info}'",
120
 
                            ["GOOD-MIB.mib: Info. No accessfunction for 'sysDescr'",
 
146
                            ["\\[GOOD-MIB[.]mib\\]\\[INF\\]: No accessfunction for 'sysDescr' => using default",
121
147
                             "_OK_"]),
122
148
                  ?line true = exists(Output),
123
149
                  ?line ok = file:delete(Output);
182
208
    ?line true = filelib:is_file("test.beam"),
183
209
    ok.
184
210
 
 
211
%% Test that a large number of command line switches does not
 
212
%% overflow the argument buffer
 
213
arg_overflow(Config) when is_list(Config) ->
 
214
    ?line {SrcDir, _OutDir, Cmd} = get_cmd(Config),
 
215
    ?line FileName = filename:join(SrcDir, "erl_test_ok.erl"),
 
216
    ?line Args = lists:flatten([ ["-D", integer_to_list(N), "=1 "] ||
 
217
            N <- lists:seq(1,10000) ]),
 
218
    ?line run(Config, Cmd, FileName, Args,
 
219
              ["Warning: function foo/0 is unused\$",
 
220
               "_OK_"]),
 
221
    ok.
 
222
 
185
223
erlc() ->
186
224
    case os:find_executable("erlc") of
187
225
        false ->