File 4218-otp_SUITE-Remove-handling-of-the-gs-application.patch of Package erlang

From e53186bb937391ee5dbbf173f67c1b825682f8f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 26 Feb 2021 09:01:07 +0100
Subject: [PATCH 8/9] otp_SUITE: Remove handling of the gs application

While at it, refactor the list of filters in undefined_functions/1.
---
 erts/test/otp_SUITE.erl | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl
index 4e0db62989..b7f67790f3 100644
--- a/erts/test/otp_SUITE.erl
+++ b/erts/test/otp_SUITE.erl
@@ -85,14 +85,16 @@ undefined_functions(Config) when is_list(Config) ->
                       "Undef - Undef | ExcludedFrom",
                       [UndefS,ExcludeFrom]),
     {ok,Undef0} = xref:q(Server, lists:flatten(Q)),
-    Undef1 = erts_filter(Undef0),
-    Undef2 = hipe_filter(Undef1),
-    Undef3 = ssl_crypto_filter(Undef2),
-    Undef4 = eunit_filter(Undef3),
-    Undef5 = dialyzer_filter(Undef4),
-    Undef6 = wx_filter(Undef5),
-    Undef7 = gs_filter(Undef6),
-    Undef = diameter_filter(Undef7),
+    Filters = [fun erts_filter/1,
+               fun hipe_filter/1,
+               fun ssl_crypto_filter/1,
+               fun eunit_filter/1,
+               fun dialyzer_filter/1,
+               fun wx_filter/1,
+               fun diameter_filter/1],
+    Undef = lists:foldl(fun(Filter, Acc) ->
+                                Filter(Acc)
+                        end, Undef0, Filters),
 
     case Undef of
         [] -> ok;
@@ -155,17 +157,6 @@ wx_filter(Undef) ->
         _ -> Undef
     end.
 
-gs_filter(Undef) ->
-    case code:lib_dir(gs) of
-        {error,bad_name} ->
-            filter(fun({_,{gs,_,_}}) -> false;
-                      ({_,{gse,_,_}}) -> false;
-                      ({_,{tool_utils,_,_}}) -> false;
-                      (_) -> true
-                   end, Undef);
-        _ -> Undef
-    end.
-
 diameter_filter(Undef) ->
     %% Filter away function calls that are caught.
     filter(fun({{diameter_lib,_,_},{erlang,convert_time_unit,3}}) ->
@@ -243,7 +234,7 @@ call_to_size_1(Config) when is_list(Config) ->
 call_to_now_0(Config) when is_list(Config) ->
     %% Applications that do not call erlang:now/0:
     Apps = [asn1,common_test,compiler,debugger,dialyzer,
-            gs,kernel,mnesia,observer,parsetools,reltool,
+            kernel,mnesia,observer,parsetools,reltool,
             runtime_tools,sasl,stdlib,syntax_tools,
             tools],
     not_recommended_calls(Config, Apps, {erlang,now,0}).
-- 
2.26.2

openSUSE Build Service is sponsored by