aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-05-12 09:58:36 +0200
committerBjörn Gustavsson <[email protected]>2016-05-13 10:52:25 +0200
commit0e78d96d9a4a46316ba3be0f4bd17ea4eafb597a (patch)
tree57a87fd0006647d52726264375f4b327609e976e
parent747e9cebee47272704342895bc57cf5edd83b550 (diff)
downloadotp-0e78d96d9a4a46316ba3be0f4bd17ea4eafb597a.tar.gz
otp-0e78d96d9a4a46316ba3be0f4bd17ea4eafb597a.tar.bz2
otp-0e78d96d9a4a46316ba3be0f4bd17ea4eafb597a.zip
test_lib: Add is_cloned_mod/1
Add is_cloned_mod(Mod) to determine whether Mod is the original name for a module (e.g. record_SUITE) or a cloned module (e.g. record_no_opt_SUITE).
-rw-r--r--lib/compiler/test/test_lib.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index a9236df414..d5b79e2357 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -22,7 +22,7 @@
-include_lib("common_test/include/ct.hrl").
-compile({no_auto_import,[binary_part/2]}).
-export([id/1,recompile/1,parallel/0,uniq/0,opt_opts/1,get_data_dir/1,
- smoke_disasm/1,p_run/2,binary_part/2]).
+ is_cloned_mod/1,smoke_disasm/1,p_run/2,binary_part/2]).
id(I) -> I.
@@ -91,6 +91,17 @@ get_data_dir(Config) ->
Data = re:replace(Data1, "_post_opt_SUITE", "_SUITE", Opts),
re:replace(Data, "_inline_SUITE", "_SUITE", Opts).
+is_cloned_mod(Mod) ->
+ is_cloned_mod_1(atom_to_list(Mod)).
+
+%% Test whether Mod is a cloned module.
+
+is_cloned_mod_1("no_opt_SUITE") -> true;
+is_cloned_mod_1("post_opt_SUITE") -> true;
+is_cloned_mod_1("inline_SUITE") -> true;
+is_cloned_mod_1([_|T]) -> is_cloned_mod_1(T);
+is_cloned_mod_1([]) -> false.
+
%% p_run(fun(Data) -> ok|error, List) -> ok
%% Will fail the test case if there were any errors.