diff options
author | Micael Karlberg <[email protected]> | 2011-09-23 14:10:53 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-09-23 14:10:53 +0200 |
commit | 524ad34276ef31fc5c306943539e3fe9bd19ad8c (patch) | |
tree | b6d497f9461375b02527bc3d1f10c7a58f3e38e0 /erts/test/erlc_SUITE.erl | |
parent | 3f9de4601b8539eea14de2d1517f54956e05d03a (diff) | |
parent | 92657321ac647f343c6b88985d66a2d611fd982d (diff) | |
download | otp-524ad34276ef31fc5c306943539e3fe9bd19ad8c.tar.gz otp-524ad34276ef31fc5c306943539e3fe9bd19ad8c.tar.bz2 otp-524ad34276ef31fc5c306943539e3fe9bd19ad8c.zip |
Merge branch 'major' of super:otp into bmk/inets/inets58_integration
Diffstat (limited to 'erts/test/erlc_SUITE.erl')
-rw-r--r-- | erts/test/erlc_SUITE.erl | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index 62e0e6813d..a9e28672e3 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -79,7 +79,7 @@ compile_erl(Config) when is_list(Config) -> ?line run(Config, Cmd, FileName, "-Werror", ["compile: warnings being treated as errors\$", - "Warning: function foo/0 is unused\$", + "function foo/0 is unused\$", "_ERROR_"]), %% Check a bad file. @@ -213,13 +213,34 @@ deep_cwd_1(PrivDir) -> arg_overflow(Config) when is_list(Config) -> ?line {SrcDir, _OutDir, Cmd} = get_cmd(Config), ?line FileName = filename:join(SrcDir, "erl_test_ok.erl"), - ?line Args = lists:flatten([ ["-D", integer_to_list(N), "=1 "] || - N <- lists:seq(1,10000) ]), + %% Each -D option will be expanded to three arguments when + %% invoking 'erl'. + ?line NumDOptions = num_d_options(), + ?line Args = lists:flatten([ ["-D", integer_to_list(N, 36), "=1 "] || + N <- lists:seq(1, NumDOptions) ]), ?line run(Config, Cmd, FileName, Args, ["Warning: function foo/0 is unused\$", "_OK_"]), ok. +num_d_options() -> + case {os:type(),os:version()} of + {{win32,_},_} -> + %% The maximum size of a command line in the command + %% shell on Windows is 8191 characters. + %% Each -D option is expanded to "@dv NN 1", i.e. + %% 8 characters. (Numbers up to 1295 can be expressed + %% as two 36-base digits.) + 1000; + {{unix,linux},Version} when Version < {2,6,23} -> + %% On some older 64-bit versions of Linux, the maximum number + %% of arguments is 16383. + %% See: http://www.in-ulm.de/~mascheck/various/argmax/ + 5440; + {_,_} -> + 12000 + end. + erlc() -> case os:find_executable("erlc") of false -> |