aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-09-10 09:07:00 +0200
committerBjörn Gustavsson <[email protected]>2013-09-18 11:45:00 +0200
commit84836ff4cee2b1f05d796bb327d0c5138553f6ec (patch)
treecdbf9466ccafea03a393c94aec424d3fd21f3cf3 /lib/asn1/test/asn1_SUITE.erl
parent85354c27e11e109efb94bd4f867831a295c1a1cf (diff)
downloadotp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.tar.gz
otp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.tar.bz2
otp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.zip
Don't allow unused exported functions in test case helpers
To keep the test case clean, add an xref test case to ensure that there are no unused functions in the any of the test case helper modules. Eliminate 4 functions that were exported just so that timer:tc/3 could be used (use timer:tc/1 with a fun instead).
Diffstat (limited to 'lib/asn1/test/asn1_SUITE.erl')
-rw-r--r--lib/asn1/test/asn1_SUITE.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 66cfdfa629..1f13faa220 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -67,6 +67,7 @@ groups() ->
{parallel, parallel([]),
[cover,
+ xref,
{group, ber},
% Uses 'P-Record', 'Constraints', 'MEDIA-GATEWAY-CONTROL'...
{group, [], [parse,
@@ -1269,3 +1270,17 @@ ticket7904(Config) ->
{ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1),
{ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1).
+
+xref(_Config) ->
+ xref:start(s),
+ xref:set_default(s, [{verbose,false},{warnings,false},{builtins,true}]),
+ Test = filename:dirname(code:which(?MODULE)),
+ {ok,_PMs} = xref:add_directory(s, Test),
+ UnusedExports = "X - XU - asn1_appup_test - asn1_app_test - \".*_SUITE\" : Mod",
+ case xref:q(s, UnusedExports) of
+ {ok,[]} ->
+ ok;
+ {ok,[_|_]=Res} ->
+ io:format("Exported, but unused: ~p\n", [Res]),
+ ?t:fail()
+ end.