aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-09-08 11:47:47 +0200
committerBjörn Gustavsson <[email protected]>2011-09-08 11:47:47 +0200
commit6fae573fc291f4a77282b918cae346064bece80e (patch)
tree0ece3805c40146b3ff0c10af51a9f33bf7b6a807 /erts
parentafa7e184442220adfe434ee3b04e1dcc85bc4a32 (diff)
parenta192de2308734a5b2cdb4adc859bdb65da6dfb3e (diff)
downloadotp-6fae573fc291f4a77282b918cae346064bece80e.tar.gz
otp-6fae573fc291f4a77282b918cae346064bece80e.tar.bz2
otp-6fae573fc291f4a77282b918cae346064bece80e.zip
Merge branch 'dev' into major
* dev: erlc_SUITE: Fix arg_overflow/1 test case
Diffstat (limited to 'erts')
-rw-r--r--erts/test/erlc_SUITE.erl25
1 files changed, 23 insertions, 2 deletions
diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl
index 62e0e6813d..2b5cb11f02 100644
--- a/erts/test/erlc_SUITE.erl
+++ b/erts/test/erlc_SUITE.erl
@@ -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 ->