File 0522-map_SUITE-Avoid-skipping-badmap17-1-in-map_no_opt_SU.patch of Package erlang

From 21ff27b794e6ddc6e97c06672de33a35cf09494f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Wed, 25 Sep 2019 16:06:10 +0200
Subject: [PATCH 4/4] map_SUITE: Avoid skipping badmap17/1 in map_no_opt_SUITE

---
 erts/emulator/test/map_SUITE.erl | 136 +++++++++++++++++++++------------------
 1 file changed, 73 insertions(+), 63 deletions(-)

diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl
index 9ea59e1084..4b638b9082 100644
--- a/erts/emulator/test/map_SUITE.erl
+++ b/erts/emulator/test/map_SUITE.erl
@@ -17,7 +17,8 @@
 %% %CopyrightEnd%
 %%
 -module(map_SUITE).
--export([all/0, suite/0, init_per_suite/1, end_per_suite/1]).
+-export([all/0, suite/0, init_per_suite/1, end_per_suite/1,
+         groups/0]).
 
 -export([t_build_and_match_literals/1, t_build_and_match_literals_large/1,
          t_update_literals/1, t_update_literals_large/1,
@@ -100,62 +101,77 @@
 
 suite() -> [].
 
-all() -> [t_build_and_match_literals, t_build_and_match_literals_large,
-          t_update_literals, t_update_literals_large,
-          t_match_and_update_literals, t_match_and_update_literals_large,
-          t_update_map_expressions,
-          t_update_assoc, t_update_assoc_large,
-          t_update_exact, t_update_exact_large,
-          t_guard_bifs,
-          t_guard_sequence, t_guard_sequence_large,
-          t_guard_update, t_guard_update_large,
-          t_guard_receive, t_guard_receive_large,
-          t_guard_fun, t_list_comprehension,
-          t_update_deep,
-          t_map_equal, t_map_compare,
-          t_map_sort_literals,
-
-          %% Specific Map BIFs
-          t_bif_map_get,t_bif_map_find,t_bif_map_is_key,
-          t_bif_map_keys, t_bif_map_merge, t_bif_map_new,
-          t_bif_map_put,
-          t_bif_map_remove,
-          t_bif_map_take, t_bif_map_take_large,
-          t_bif_map_update,
-          t_bif_map_values,
-          t_bif_map_to_list, t_bif_map_from_list,
-          t_bif_map_next,
-
-          %% erlang
-          t_erlang_hash, t_map_encode_decode,
-          t_gc_rare_map_overflow,
-          t_map_size, t_map_get, t_is_map,
-
-          %% non specific BIF related
-          t_bif_build_and_check,
-          t_bif_merge_and_check,
-
-          %% maps module
-          t_maps_fold, t_maps_map,
-          t_maps_size, t_maps_without,
-
-
-          %% Other functions
-          t_hashmap_balance,
-          t_erts_internal_order,
-          t_erts_internal_hash,
-          t_pdict,
-          t_ets,
-          t_tracing,
-          t_hash_entropy,
-
-          %% instruction-level tests
-          t_has_map_fields,
-          y_regs,
-          badmap_17,
-
-          %% Bugs
-          t_large_unequal_bins_same_hash_bug].
+all() ->
+    run_once() ++ [{group,main}].
+
+groups() ->
+    [{main,[],
+      [t_build_and_match_literals, t_build_and_match_literals_large,
+       t_update_literals, t_update_literals_large,
+       t_match_and_update_literals, t_match_and_update_literals_large,
+       t_update_map_expressions,
+       t_update_assoc, t_update_assoc_large,
+       t_update_exact, t_update_exact_large,
+       t_guard_bifs,
+       t_guard_sequence, t_guard_sequence_large,
+       t_guard_update, t_guard_update_large,
+       t_guard_receive, t_guard_receive_large,
+       t_guard_fun, t_list_comprehension,
+       t_update_deep,
+       t_map_equal, t_map_compare,
+       t_map_sort_literals,
+
+       %% Specific Map BIFs
+       t_bif_map_get,t_bif_map_find,t_bif_map_is_key,
+       t_bif_map_keys, t_bif_map_merge, t_bif_map_new,
+       t_bif_map_put,
+       t_bif_map_remove,
+       t_bif_map_take, t_bif_map_take_large,
+       t_bif_map_update,
+       t_bif_map_values,
+       t_bif_map_to_list, t_bif_map_from_list,
+       t_bif_map_next,
+
+       %% erlang
+       t_erlang_hash, t_map_encode_decode,
+       t_gc_rare_map_overflow,
+       t_map_size, t_map_get, t_is_map,
+
+       %% non specific BIF related
+       t_bif_build_and_check,
+       t_bif_merge_and_check,
+
+       %% maps module
+       t_maps_fold, t_maps_map,
+       t_maps_size, t_maps_without,
+
+
+       %% Other functions
+       t_hashmap_balance,
+       t_erts_internal_order,
+       t_erts_internal_hash,
+       t_pdict,
+       t_ets,
+       t_tracing,
+       t_hash_entropy,
+
+       %% instruction-level tests
+       t_has_map_fields,
+       y_regs,
+
+       %% Bugs
+       t_large_unequal_bins_same_hash_bug]},
+     {once,[],[badmap_17]}].
+
+run_once() ->
+    case ?MODULE of
+	map_SUITE ->
+            %% Canononical module name. Run these cases.
+            [{group,once}];
+        _ ->
+            %% Cloned module. Don't run.
+            []
+    end.
 
 init_per_suite(Config) ->
     A0 = case application:start(sasl) of
@@ -3163,12 +3179,6 @@ do_badmap(Test) ->
 %% Test that a module compiled with the OTP 17 compiler will
 %% generate the correct 'badmap' exception.
 badmap_17(Config) ->
-    case ?MODULE of
-	map_SUITE -> do_badmap_17(Config);
-	_ -> {skip,"Run in map_SUITE"}
-    end.
-
-do_badmap_17(Config) ->
     Mod = badmap_17,
     DataDir = test_server:lookup_config(data_dir, Config),
     Beam = filename:join(DataDir, Mod),
-- 
2.16.4

openSUSE Build Service is sponsored by