aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/beam_lib.erl2
-rw-r--r--lib/stdlib/src/erl_compile.erl1
-rw-r--r--lib/stdlib/src/escript.erl1
-rw-r--r--lib/stdlib/src/proc_lib.erl14
-rw-r--r--lib/stdlib/test/binary_module_SUITE.erl29
-rw-r--r--lib/stdlib/test/ets_SUITE.erl32
-rw-r--r--lib/stdlib/test/io_SUITE.erl44
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl3
-rw-r--r--lib/stdlib/test/rand_SUITE.erl28
-rw-r--r--lib/stdlib/test/select_SUITE.erl30
-rw-r--r--lib/stdlib/test/unicode_SUITE.erl24
11 files changed, 56 insertions, 152 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl
index 7a17226e46..fe9df601eb 100644
--- a/lib/stdlib/src/beam_lib.erl
+++ b/lib/stdlib/src/beam_lib.erl
@@ -46,7 +46,7 @@
terminate/2,code_change/3]).
-export([make_crypto_key/2, get_crypto_key/1]). %Utilities used by compiler
--export_type([attrib_entry/0, compinfo_entry/0, labeled_entry/0]).
+-export_type([attrib_entry/0, compinfo_entry/0, labeled_entry/0, label/0]).
-import(lists, [append/1, delete/2, foreach/2, keysort/2,
member/2, reverse/1, sort/1, splitwith/2]).
diff --git a/lib/stdlib/src/erl_compile.erl b/lib/stdlib/src/erl_compile.erl
index ef54076ee3..a6ae398d03 100644
--- a/lib/stdlib/src/erl_compile.erl
+++ b/lib/stdlib/src/erl_compile.erl
@@ -60,6 +60,7 @@ compile_cmdline() ->
_ -> my_halt(2)
end.
+-spec my_halt(_) -> no_return().
my_halt(Reason) ->
erlang:halt(Reason).
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index b8ce311c35..f53b0e2246 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -906,6 +906,7 @@ anno(L) ->
fatal(Str) ->
throw(Str).
+-spec my_halt(_) -> no_return().
my_halt(Reason) ->
erlang:halt(Reason).
diff --git a/lib/stdlib/src/proc_lib.erl b/lib/stdlib/src/proc_lib.erl
index 4a19603ec2..3dc1848550 100644
--- a/lib/stdlib/src/proc_lib.erl
+++ b/lib/stdlib/src/proc_lib.erl
@@ -479,18 +479,12 @@ trans_init(gen,init_it,[gen_server,_,_,supervisor_bridge,[Module|_],_]) ->
{supervisor_bridge,Module,1};
trans_init(gen,init_it,[gen_server,_,_,_,supervisor_bridge,[Module|_],_]) ->
{supervisor_bridge,Module,1};
-trans_init(gen,init_it,[GenMod,_,_,Module,_,_])
- when GenMod =:= gen_server;
- GenMod =:= gen_statem;
- GenMod =:= gen_fsm ->
- {Module,init,1};
-trans_init(gen,init_it,[GenMod,_,_,_,Module|_])
- when GenMod =:= gen_server;
- GenMod =:= gen_statem;
- GenMod =:= gen_fsm ->
- {Module,init,1};
trans_init(gen,init_it,[gen_event|_]) ->
{gen_event,init_it,6};
+trans_init(gen,init_it,[_GenMod,_,_,Module,_,_]) when is_atom(Module) ->
+ {Module,init,1};
+trans_init(gen,init_it,[_GenMod,_,_,_,Module|_]) when is_atom(Module) ->
+ {Module,init,1};
trans_init(M, F, A) when is_atom(M), is_atom(F) ->
{M,F,length(A)}.
diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl
index 55fdcdd054..c5cfea5e9e 100644
--- a/lib/stdlib/test/binary_module_SUITE.erl
+++ b/lib/stdlib/test/binary_module_SUITE.erl
@@ -19,9 +19,7 @@
%%
-module(binary_module_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2,
- init_per_group/2,end_per_group/2,
+-export([all/0, suite/0,
interesting/1,scope_return/1,random_ref_comp/1,random_ref_sr_comp/1,
random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1,
copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]).
@@ -30,15 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
-
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,30}}].
+ {timetrap,{minutes,10}}].
all() ->
[scope_return,interesting, random_ref_fla_comp, random_ref_sr_comp,
@@ -46,21 +38,6 @@ all() ->
referenced, guard, encode_decode, badargs,
longest_common_trap].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))).
@@ -961,6 +938,7 @@ random_parts(X,N) ->
%% Test pseudorandomly generated cases against reference implementation.
random_ref_comp(Config) when is_list(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a lot of time
put(success_counter,0),
rand:seed(exsplus, {1271,769940,559934}),
Nr = {1,40},
@@ -991,6 +969,7 @@ random_ref_comp(Config) when is_list(Config) ->
%% Test pseudorandomly generated cases against reference implementation
%% of split and replace.
random_ref_sr_comp(Config) when is_list(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a lot
put(success_counter,0),
rand:seed(exsplus, {1271,769940,559934}),
Nr = {1,40},
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 15e3142408..8c1c625676 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -125,7 +125,7 @@ end_per_testcase(_Func, _Config) ->
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,20}}].
+ {timetrap,{minutes,5}}].
all() ->
[{group, new}, {group, insert}, {group, lookup},
@@ -698,7 +698,7 @@ chk_normal_tab_struct_size() ->
io:format("?TAB_STRUCT_SZ=~p~n", [?TAB_STRUCT_SZ]),
ok.
-adjust_xmem([T1,T2,T3,T4], {A0,B0,C0,D0} = _Mem0) ->
+adjust_xmem([_T1,_T2,_T3,_T4], {A0,B0,C0,D0} = _Mem0) ->
%% Adjust for 64-bit, smp, and os:
%% Table struct size may differ.
@@ -2809,16 +2809,22 @@ privacy_do(Opts) ->
privacy_check(pub,prot,priv),
Owner ! {shift,1,{pub,prot,priv}},
- receive {Pub1,Prot1,Priv1} -> ok end,
- privacy_check(Pub1,Prot1,Priv1),
+ receive
+ {Pub1,Prot1,Priv1} ->
+ ok = privacy_check(Pub1,Prot1,Priv1),
+ Owner ! {shift,2,{Pub1,Prot1,Priv1}}
+ end,
- Owner ! {shift,2,{Pub1,Prot1,Priv1}},
- receive {Pub2,Prot2,Priv2} -> ok end,
- privacy_check(Pub2,Prot2,Priv2),
+ receive
+ {Pub2,Prot2,Priv2} ->
+ ok = privacy_check(Pub2,Prot2,Priv2),
+ Owner ! {shift,0,{Pub2,Prot2,Priv2}}
+ end,
- Owner ! {shift,0,{Pub2,Prot2,Priv2}},
- receive {Pub2,Prot2,Priv2} -> ok end,
- privacy_check(Pub2,Prot2,Priv2),
+ receive
+ {Pub3,Prot3,Priv3} ->
+ ok = privacy_check(Pub3,Prot3,Priv3)
+ end,
Owner ! die,
receive {'EXIT',Owner,_} -> ok end,
@@ -2836,7 +2842,8 @@ privacy_check(Pub,Prot,Priv) ->
{'EXIT',{badarg,_}} = (catch ets:insert(Priv,{3,foo})),
%% check that it really wasn't written, either
- [] = ets:lookup(Prot,foo).
+ [] = ets:lookup(Prot,foo),
+ ok.
privacy_owner(Boss, Opts) ->
ets_new(pub, [public,named_table | Opts]),
@@ -3197,7 +3204,6 @@ delete_large_named_table_1(Name, Flags, Data, Fix) ->
true = ets:safe_fixtable(Tab, true),
lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
end,
- Parent = self(),
{Pid, MRef} = my_spawn_opt(fun() ->
receive
ets_new ->
@@ -3297,6 +3303,7 @@ exit_large_table_owner_do(Opts,{FEData,Config}) ->
verify_rescheduling_exit(Config, FEData, Opts, false, 1, 1).
exit_many_large_table_owner(Config) when is_list(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a lot
%%Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
FEData = fun(Do) -> repeat_while(fun(500000) -> {false,ok};
(I) -> Do({erlang:phash2(I, 16#ffffff),I}),
@@ -4270,6 +4277,7 @@ do_lookup_element(Tab, N, M) ->
heavy_concurrent(Config) when is_list(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a lot of time
repeat_for_opts(do_heavy_concurrent).
do_heavy_concurrent(Opts) ->
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index be6b470ca7..7d48cbc97c 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -19,10 +19,7 @@
%%
-module(io_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2]).
-
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
-export([error_1/1, float_g/1, otp_5403/1, otp_5813/1, otp_6230/1,
otp_6282/1, otp_6354/1, otp_6495/1, otp_6517/1, otp_6502/1,
@@ -51,12 +48,6 @@
-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
-endif.
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
-
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,1}}].
@@ -72,22 +63,6 @@ all() ->
io_lib_width_too_small, io_with_huge_message_queue,
format_string, maps, coverage].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
%% Error cases for output.
error_1(Config) when is_list(Config) ->
%% We don't do erroneous output on stdout - the test server
@@ -952,7 +927,7 @@ otp_6708(Config) when is_list(Config) ->
otp_7084() ->
- [{timetrap,{minutes,3}}].
+ [{timetrap,{minutes,6}}]. %% valgrind needs a lot of time
%% OTP-7084. Printing floating point numbers nicely.
otp_7084(Config) when is_list(Config) ->
@@ -1830,13 +1805,14 @@ bad_printable_range(Config) when is_list(Config) ->
Cmd = lists:concat([lib:progname()," +pcunnnnnicode -run erlang halt"]),
P = open_port({spawn, Cmd}, [stderr_to_stdout, {line, 200}]),
ok = receive
- {P, {data, {eol , "bad range of printable characters" ++ _}}} ->
- ok;
- Other ->
- Other
- after 1000 ->
- timeout
- end,
+ {P, {data, {eol , "bad range of printable characters" ++ _}}} ->
+ ok;
+ Other ->
+ Other
+ %% valgrind needs a lot of time
+ after 6000 ->
+ timeout
+ end,
catch port_close(P),
flush_from_port(P),
ok.
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index 4e39f011f6..1e286a9306 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -75,7 +75,7 @@ end_per_testcase(_Case, Config) ->
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,20}}].
+ {timetrap,{minutes,5}}].
all() ->
[setopts_getopts, unicode_options, unicode_options_gen,
@@ -462,6 +462,7 @@ unicode_options(Config) when is_list(Config) ->
%% Tests various unicode options on random generated files.
unicode_options_gen(Config) when is_list(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a alot of time
random:seed(1240, 900586, 553728),
PrivDir = proplists:get_value(priv_dir, Config),
AllModes = [utf8,utf16,{utf16,big},{utf16,little},
diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl
index 1bcdc3ccd0..cb778c96d4 100644
--- a/lib/stdlib/test/rand_SUITE.erl
+++ b/lib/stdlib/test/rand_SUITE.erl
@@ -18,18 +18,13 @@
%% %CopyrightEnd%
-module(rand_SUITE).
--export([all/0, suite/0,groups/0,
- init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2, end_per_testcase/2
- ]).
+-export([all/0, suite/0,groups/0]).
-export([interval_int/1, interval_float/1, seed/1,
api_eq/1, reference/1,
basic_stats_uniform_1/1, basic_stats_uniform_2/1,
basic_stats_normal/1,
- plugin/1, measure/1
- ]).
+ plugin/1, measure/1]).
-export([test/0, gen/1]).
@@ -37,12 +32,6 @@
-define(LOOP, 1000000).
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
-
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,3}}].
@@ -52,19 +41,12 @@ all() ->
api_eq,
reference,
{group, basic_stats},
- plugin, measure
- ].
+ plugin, measure].
groups() ->
[{basic_stats, [parallel],
[basic_stats_uniform_1, basic_stats_uniform_2, basic_stats_normal]}].
-init_per_suite(Config) -> Config.
-end_per_suite(_Config) -> ok.
-
-init_per_group(_GroupName, Config) -> Config.
-end_per_group(_GroupName, Config) -> Config.
-
%% A simple helper to test without test_server during dev
test() ->
Tests = all(),
@@ -285,16 +267,19 @@ gen(_, _, Acc) -> lists:reverse(Acc).
%% Check that the algorithms generate sound values.
basic_stats_uniform_1(Config) when is_list(Config) ->
+ ct:timetrap({minutes,6}), %% valgrind needs a lot of time
[basic_uniform_1(?LOOP, rand:seed_s(Alg), 0.0, array:new([{default, 0}]))
|| Alg <- algs()],
ok.
basic_stats_uniform_2(Config) when is_list(Config) ->
+ ct:timetrap({minutes,6}), %% valgrind needs a lot of time
[basic_uniform_2(?LOOP, rand:seed_s(Alg), 0, array:new([{default, 0}]))
|| Alg <- algs()],
ok.
basic_stats_normal(Config) when is_list(Config) ->
+ ct:timetrap({minutes,6}), %% valgrind needs a lot of time
io:format("Testing normal~n",[]),
[basic_normal_1(?LOOP, rand:seed_s(Alg), 0, 0) || Alg <- algs()],
ok.
@@ -395,6 +380,7 @@ crypto_uniform_n(N, State0) ->
%% Not a test but measures the time characteristics of the different algorithms
measure(Suite) when is_atom(Suite) -> [];
measure(_Config) ->
+ ct:timetrap({minutes,6}), %% valgrind needs a lot of time
Algos = [crypto64|algs()],
io:format("RNG uniform integer performance~n",[]),
_ = measure_1(random, fun(State) -> {int, random:uniform_s(10000, State)} end),
diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl
index e999d040c9..22b6d37e5d 100644
--- a/lib/stdlib/test/select_SUITE.erl
+++ b/lib/stdlib/test/select_SUITE.erl
@@ -59,42 +59,20 @@ config(priv_dir,_) ->
".".
-else.
%% When run in test server.
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,select_test/1,
- init_per_testcase/2, end_per_testcase/2,
- return_values/1]).
-
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
+-export([all/0, suite/0,
+ select_test/1, return_values/1]).
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,20}}].
+ {timetrap,{minutes,1}}].
all() ->
[return_values, select_test].
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
%% Test select in numerous ways.
select_test(Config) when is_list(Config) ->
+ ct:timetrap({minutes,40}), %% valgrinds needs a lot of time
do_test(Config).
%% Test return values in specific situations for select/3 and select/1.
diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl
index 81a591f433..07d63bdf22 100644
--- a/lib/stdlib/test/unicode_SUITE.erl
+++ b/lib/stdlib/test/unicode_SUITE.erl
@@ -21,10 +21,7 @@
-include_lib("common_test/include/ct.hrl").
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- init_per_testcase/2,
- end_per_testcase/2,
+-export([all/0, suite/0,groups/0,
utf8_illegal_sequences_bif/1,
utf16_illegal_sequences_bif/1,
random_lists/1,
@@ -38,12 +35,6 @@
ex_binaries_errors_utf32_little/1,
ex_binaries_errors_utf32_big/1]).
-init_per_testcase(_Case, Config) ->
- Config.
-
-end_per_testcase(_Case, _Config) ->
- ok.
-
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,20}}].
@@ -63,18 +54,6 @@ groups() ->
ex_binaries_errors_utf32_little,
ex_binaries_errors_utf32_big]}].
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
binaries_errors_limit(Config) when is_list(Config) ->
setlimit(10),
ex_binaries_errors_utf8(Config),
@@ -761,6 +740,7 @@ leading_lo_surrogate_bif(HiSurr, LoSurr, End) when LoSurr =< End ->
leading_lo_surrogate_bif(_, _, _) -> ok.
utf8_illegal_sequences_bif(Config) when is_list(Config) ->
+ ct:timetrap({minutes,40}), %% valgrind needs a lot
setlimit(10),
ex_utf8_illegal_sequences_bif(Config),
setlimit(default),