aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/module_info_SUITE.erl
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2014-05-14 14:46:46 +0200
committerSverker Eriksson <[email protected]>2014-05-14 14:46:46 +0200
commitfdb350a4c98f070c264b8bd4ea9eca2513352f21 (patch)
tree5ebc56a09dc83aca5d194f570cf98e7193ecc88f /erts/emulator/test/module_info_SUITE.erl
parent07b8f441ca711f9812fad9e9115bab3c3aa92f79 (diff)
downloadotp-fdb350a4c98f070c264b8bd4ea9eca2513352f21.tar.gz
otp-fdb350a4c98f070c264b8bd4ea9eca2513352f21.tar.bz2
otp-fdb350a4c98f070c264b8bd4ea9eca2513352f21.zip
Add 'md5' entry for module_info/0/1 functions.
Diffstat (limited to 'erts/emulator/test/module_info_SUITE.erl')
-rw-r--r--erts/emulator/test/module_info_SUITE.erl21
1 files changed, 18 insertions, 3 deletions
diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl
index 8a63d9fe3e..06cd2a9b9a 100644
--- a/erts/emulator/test/module_info_SUITE.erl
+++ b/erts/emulator/test/module_info_SUITE.erl
@@ -24,7 +24,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
- exports/1,functions/1,native/1]).
+ exports/1,functions/1,native/1,info/1]).
%%-compile(native).
@@ -52,8 +52,8 @@ end_per_group(_GroupName, Config) ->
Config.
-modules() ->
- [exports, functions, native].
+modules() ->
+ [exports, functions, native, info].
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
Dog = ?t:timetrap(?t:minutes(3)),
@@ -122,6 +122,21 @@ native_proj({Name,Arity,Addr}) ->
native_filter(Set) ->
sofs:no_elements(Set) =/= 1.
+%% Test that the module info of this module is correct. Use
+%% erlang:get_module_info(?MODULE) to avoid compiler optimization tricks.
+info(Config) when is_list(Config) ->
+ Info = erlang:get_module_info(?MODULE),
+ All = all_exported(),
+ {ok,{?MODULE,MD5}} = beam_lib:md5(code:which(?MODULE)),
+ {md5, MD5} = lists:keyfind(md5, 1, Info),
+ {exports, Exports} = lists:keyfind(exports, 1, Info),
+ All = lists:sort(Exports),
+ {attributes, Attrs} = lists:keyfind(attributes, 1, Info),
+ {vsn,_} = lists:keyfind(vsn, 1, Attrs),
+ {compile, Compile} = lists:keyfind(compile, 1, Info),
+ {options,_} = lists:keyfind(options, 1, Compile),
+ ok.
+
%% Helper functions (local).
add_arity(L) ->