aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-04-04 06:09:31 +0200
committerBjörn Gustavsson <[email protected]>2019-04-05 07:28:27 +0200
commit1a58a7c0a9af1eb98ddfecbc6157325f2c869eb1 (patch)
tree12265b7124326958d4265da6173ef0d06f093522 /lib/stdlib/test
parent3d259fd70ed9e24e59746c5958730892e505f1cb (diff)
downloadotp-1a58a7c0a9af1eb98ddfecbc6157325f2c869eb1.tar.gz
otp-1a58a7c0a9af1eb98ddfecbc6157325f2c869eb1.tar.bz2
otp-1a58a7c0a9af1eb98ddfecbc6157325f2c869eb1.zip
Add options for suppressing warnings about removed functions
An appliction outside of OTP may want to reuse then name of a module that was previously included in OTP. Therefore, there should be a way to suppress warnings for removed functions.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 6d604794e7..939cc1024c 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -2112,7 +2112,29 @@ otp_5362(Config) when is_list(Config) ->
<<"t(X) -> erlang:hash(X, 10000).">>,
[],
{warnings,
- [{1,erl_lint,{removed,{erlang,hash,2},{erlang,phash2,2},"20.0"}}]}}
+ [{1,erl_lint,{removed,{erlang,hash,2},{erlang,phash2,2},"20.0"}}]}},
+
+ {nowarn_call_removed_function_1,
+ <<"t(X) -> erlang:hash(X, 10000).">>,
+ [{nowarn_removed,{erlang,hash,2}}],
+ []},
+
+ {nowarn_call_removed_function_2,
+ <<"t(X) -> os_mon_mib:any_function_really(erlang:hash(X, 10000)).">>,
+ [nowarn_removed],
+ []},
+
+ {call_removed_module,
+ <<"t(X) -> os_mon_mib:any_function_really(X).">>,
+ [],
+ {warnings,[{1,erl_lint,
+ {removed,{os_mon_mib,any_function_really,1},
+ "was removed in 22.0"}}]}},
+
+ {nowarn_call_removed_module,
+ <<"t(X) -> os_mon_mib:any_function_really(X).">>,
+ [{nowarn_removed,os_mon_mib}],
+ []}
],