diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2023-02-18 14:16:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-18 14:16:57 +0100 |
commit | 3b8b98c6df7827de098f6fa21db690510e106161 (patch) | |
tree | b205fbaf44fd86dea0edc512d1b3b50a4b03e080 /erts/test | |
parent | 51bc5d4571380db4e95a5cf76e31d121cca0249e (diff) | |
parent | c089382b5bb889371a9452f8b4f7314711e371b9 (diff) | |
download | erlang-3b8b98c6df7827de098f6fa21db690510e106161.tar.gz |
Merge pull request #6880 from bjorng/bjorn/non-recommended-functions
otp_SUITE: Update tests for non-recommended functions
Diffstat (limited to 'erts/test')
-rw-r--r-- | erts/test/otp_SUITE.erl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index 7552dc80b3..1eccb59875 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -218,17 +218,13 @@ call_to_deprecated(Config) when is_list(Config) -> {comment,integer_to_list(length(DeprecatedCalls))++" calls to deprecated functions"}. call_to_size_1(Config) when is_list(Config) -> - %% Applications that do not call erlang:size/1: - Apps = [asn1,compiler,debugger,kernel,observer,parsetools, - runtime_tools,stdlib,tools], + %% Forbid the use of erlang:size/1 in all applications. + Apps = all_applications(Config), not_recommended_calls(Config, Apps, {erlang,size,1}). call_to_now_0(Config) when is_list(Config) -> - %% Applications that do not call erlang:now/1: - Apps = [asn1,common_test,compiler,debugger,dialyzer, - kernel,mnesia,observer,parsetools,reltool, - runtime_tools,sasl,stdlib,syntax_tools, - tools], + %% Forbid the use of erlang:now/1 in all applications except et. + Apps = all_applications(Config) -- [et], not_recommended_calls(Config, Apps, {erlang,now,0}). not_recommended_calls(Config, Apps0, MFA) -> @@ -281,9 +277,14 @@ not_recommended_calls(Config, Apps0, MFA) -> {comment, Mess} end; _ -> - ct:fail({length(CallsToMFA),calls_to_size_1}) + ct:fail({length(CallsToMFA),calls_to,MFA}) end. +all_applications(Config) -> + Server = proplists:get_value(xref_server, Config), + {ok,AllApplications} = xref:q(Server, "A"), + AllApplications. + is_present_application(Name, Server) -> Q = io_lib:format("~w : App", [Name]), case xref:q(Server, lists:flatten(Q)) of |