File 2146-stdlib-test-suite-fix-uses-of-export_all.patch of Package erlang

From 13838af02bc54db57264c4f198bc819809d65481 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <richardc@klarna.com>
Date: Wed, 30 Nov 2016 10:34:59 +0100
Subject: [PATCH 6/6] stdlib test suite: fix uses of export_all

---
 lib/stdlib/test/epp_SUITE.erl      | 16 ++++++++--------
 lib/stdlib/test/erl_lint_SUITE.erl | 12 ++++++------
 lib/stdlib/test/qlc_SUITE.erl      |  3 +--
 lib/stdlib/test/shell_SUITE.erl    |  6 +++---
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl
index 4078513e3..71d6820c4 100644
--- a/lib/stdlib/test/epp_SUITE.erl
+++ b/lib/stdlib/test/epp_SUITE.erl
@@ -306,7 +306,7 @@ otp_5362(Config) when is_list(Config) ->
     File_Back_hrl = filename:join(Dir, "back_5362.hrl"),
     Back = <<"-module(back_5362).
 
-              -compile(export_all).
+              -export([foo/1]).
 
               -file(?FILE, 1).
               -include(\"back_5362.hrl\").
@@ -334,7 +334,7 @@ otp_5362(Config) when is_list(Config) ->
 
                 -file(?FILE, 100).
 
-                -compile(export_all).
+                -export([foo/1,bar/1]).
 
                 -file(\"other.file\", ?LINE). % like an included file...
                 foo(A) -> % line 105
@@ -362,7 +362,7 @@ otp_5362(Config) when is_list(Config) ->
 
     Blank = <<"-module(blank_5362).
 
-               -compile(export_all).
+               -export([q/1,a/1,b/1,c/1]).
 
                -
                file(?FILE, 18). q(Q) -> foo. % line 18
@@ -1258,7 +1258,7 @@ do_otp_8911(Config) ->
 
     File = "i.erl",
     Cont = <<"-module(i).
-              -compile(export_all).
+              -export([t/0]).
               -file(\"fil1\", 100).
               -include(\"i1.erl\").
               t() ->
@@ -1391,7 +1391,7 @@ otp_11728(Config) when is_list(Config) ->
     HrlFile = filename:join(Dir, "otp_11728.hrl"),
     ok = file:write_file(HrlFile, H),
     C = <<"-module(otp_11728).
-           -compile(export_all).
+           -export([function_name/0]).
 
            -include(\"otp_11728.hrl\").
 
@@ -1599,12 +1599,12 @@ check_test(Config, Test) ->
     end.
 
 compile_test(Config, Test0) ->
-    Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
+    Test = [<<"-module(epp_test). ">>, Test0],
     Filename = "epp_test.erl",
     PrivDir = proplists:get_value(priv_dir, Config),
     File = filename:join(PrivDir, Filename),
     ok = file:write_file(File, Test),
-    Opts = [export_all,return,nowarn_unused_record,{outdir,PrivDir}],
+    Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,{outdir,PrivDir}],
     case compile_file(File, Opts) of
         {ok, Ws} -> warnings(File, Ws);
         Else -> Else
@@ -1653,7 +1653,7 @@ unopaque_forms(Forms) ->
     [erl_parse:anno_to_term(Form) || Form <- Forms].
 
 run_test(Config, Test0) ->
-    Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
+    Test = [<<"-module(epp_test). -export([t/0]). ">>, Test0],
     Filename = "epp_test.erl",
     PrivDir = proplists:get_value(priv_dir, Config),
     File = filename:join(PrivDir, Filename),
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 348497647..c86e17f70 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -1863,7 +1863,7 @@ otp_5276(Config) when is_list(Config) ->
 %% OTP-5917. Check the 'deprecated' attributed.
 otp_5917(Config) when is_list(Config) ->
     Ts = [{otp_5917_1,
-          <<"-compile(export_all).
+          <<"-export([t/0]).
 
              -deprecated({t,0}).
 
@@ -1878,7 +1878,7 @@ otp_5917(Config) when is_list(Config) ->
 %% OTP-6585. Check the deprecated guards list/1, pid/1, ....
 otp_6585(Config) when is_list(Config) ->
     Ts = [{otp_6585_1,
-          <<"-compile(export_all).
+          <<"-export([t/0]).
 
              -record(r, {}).
 
@@ -2627,7 +2627,7 @@ otp_11772(Config) when is_list(Config) ->
     Ts = <<"
             -module(newly).
 
-            -compile(export_all).
+            -export([t/0]).
 
             %% Built-in:
             -type node() :: node().
@@ -2652,7 +2652,7 @@ otp_11771(Config) when is_list(Config) ->
     Ts = <<"
             -module(newly).
 
-            -compile(export_all).
+            -export([t/0]).
 
             %% No longer allowed in 17.0:
             -type arity() :: atom().
@@ -2679,7 +2679,7 @@ otp_11872(Config) when is_list(Config) ->
     Ts = <<"
             -module(map).
 
-            -compile(export_all).
+            -export([t/0]).
 
             -export_type([map/0, product/0]).
 
@@ -3005,7 +3005,7 @@ behaviour_basic(Config) when is_list(Config) ->
 
           {behaviour4,
            <<"-behavior(application).  %% Test callbacks with export_all
-              -compile(export_all).
+              -compile([export_all, nowarn_export_all]).
               stop(_) -> ok.
              ">>,
            [],
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 8c7d5a5fc..c08e138ad 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -7936,7 +7936,6 @@ compile(Config, Tests, Fun) ->
 compile_file(Config, Test0, Opts0) ->
     {File, Mod} = compile_file_mod(Config),
     Test = list_to_binary(["-module(", atom_to_list(Mod), "). "
-                           "-compile(export_all). "
                            "-import(qlc_SUITE, [i/1,i/2,format_info/2]). "
                            "-import(qlc_SUITE, [etsc/2, etsc/3]). "
                            "-import(qlc_SUITE, [create_ets/2]). "
@@ -7946,7 +7945,7 @@ compile_file(Config, Test0, Opts0) ->
                            "-import(qlc_SUITE, [lookup_keys/1]). "
                            "-include_lib(\"stdlib/include/qlc.hrl\"). ",
                            Test0]),
-    Opts = [export_all,return,nowarn_unused_record,{outdir,?privdir}|Opts0],
+    Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,{outdir,?privdir}|Opts0],
     ok = file:write_file(File, Test),
     case compile:file(File, Opts) of
         {ok, _M, Ws} -> warnings(File, Ws);
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index 07eb6772d..56d81eb1f 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -1794,7 +1794,7 @@ Test1_shell =
 Test2 =
 <<"-module(recs).
           -record(person, {name, age, phone = [], dict = []}).
--compile(export_all).
+-export([t/0]).
 
 t() -> ok.
 
@@ -1961,7 +1961,7 @@ ok.
 progex_funs(Config) when is_list(Config) ->
     Test1 = 
 	<<"-module(funs).
-          -compile(export_all).
+          -export([t/0]).
 
 double([H|T]) -> [2*H|double(T)];
 double([])    -> [].
@@ -3031,7 +3031,7 @@ run_file(Config, Module, Test) ->
     ok.
 
 compile_file(Config, File, Test, Opts0) ->
-    Opts = [export_all,return,{outdir,proplists:get_value(priv_dir, Config)}|Opts0],
+    Opts = [export_all,nowarn_export_all,return,{outdir,proplists:get_value(priv_dir, Config)}|Opts0],
     ok = file:write_file(File, Test),
     case compile:file(File, Opts) of
               {ok, _M, _Ws} -> ok;
-- 
2.11.0

openSUSE Build Service is sponsored by