aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-09-22 15:47:06 +0200
committerHans Bolinder <[email protected]>2015-09-22 15:47:06 +0200
commit1c68329cf60090ba686f6d431a1bf2b39b709fee (patch)
treed85452f5a0d503ef852734670ca0d6e1023af8b4
parentb8fbea6d3567e3445b507152355cf46e50a12cc1 (diff)
parent6fa5c094e94e06f02b717f00e90ac777652ea6b8 (diff)
downloadotp-1c68329cf60090ba686f6d431a1bf2b39b709fee.tar.gz
otp-1c68329cf60090ba686f6d431a1bf2b39b709fee.tar.bz2
otp-1c68329cf60090ba686f6d431a1bf2b39b709fee.zip
Merge branch 'hb/fix_otp_SUITE'
* hb/fix_otp_SUITE: Adjust test case for missing applications
-rw-r--r--erts/test/otp_SUITE.erl23
1 files changed, 21 insertions, 2 deletions
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl
index 69a0d19719..c92a7cf6f7 100644
--- a/erts/test/otp_SUITE.erl
+++ b/erts/test/otp_SUITE.erl
@@ -301,9 +301,11 @@ call_to_now_0(Config) when is_list(Config) ->
test_server,tools,webtool],
not_recommended_calls(Config, Apps, {erlang,now,0}).
-not_recommended_calls(Config, Apps, MFA) ->
+not_recommended_calls(Config, Apps0, MFA) ->
Server = ?config(xref_server, Config),
+ Apps = [App || App <- Apps0, is_present_application(App, Server)],
+
Fs = [MFA],
Q1 = io_lib:format("E || ~p : Fun", [Fs]),
@@ -337,11 +339,28 @@ not_recommended_calls(Config, Apps, MFA) ->
end,
case CallsToMFA of
[] ->
- ok;
+ SkippedApps = ordsets:subtract(ordsets:from_list(Apps0),
+ ordsets:from_list(Apps)),
+ case SkippedApps of
+ [] ->
+ ok;
+ _ ->
+ AppStrings = [atom_to_list(A) || A <- SkippedApps],
+ Mess = io_lib:format("Application(s) not present: ~s\n",
+ [string:join(AppStrings, ", ")]),
+ {comment, Mess}
+ end;
_ ->
?t:fail({length(CallsToMFA),calls_to_size_1})
end.
+is_present_application(Name, Server) ->
+ Q = io_lib:format("~w : App", [Name]),
+ case xref:q(Server, lists:flatten(Q)) of
+ {ok,[Name]} -> true;
+ {error,_,_} -> false
+ end.
+
strong_components(Config) when is_list(Config) ->
Server = ?config(xref_server, Config),
?line {ok,Cs} = xref:q(Server, "components AE"),