aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-03-23 08:19:03 +0100
committerJohn Högberg <[email protected]>2018-03-23 08:19:03 +0100
commit7c2672e614883d8f0eac7559a59d0373ec92af69 (patch)
tree3efd77a3e47638fab644366376dffb859a9aef96 /erts/emulator/test
parentb302412387b094bb827ea8ae5f8f3e28178c2f8b (diff)
parentf5af4ec3aec18b7237c11ec6c8b7dd9367002d37 (diff)
downloadotp-7c2672e614883d8f0eac7559a59d0373ec92af69.tar.gz
otp-7c2672e614883d8f0eac7559a59d0373ec92af69.tar.bz2
otp-7c2672e614883d8f0eac7559a59d0373ec92af69.zip
Merge branch 'john/erts/list-installed-nifs/OTP-14965'
* john/erts/list-installed-nifs/OTP-14965: Add an option to ?MODULE:module_info/1 for listing NIFs Fix a misleading comment
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/module_info_SUITE.erl18
1 files changed, 15 insertions, 3 deletions
diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl
index ba9b564fdc..46a3bba732 100644
--- a/erts/emulator/test/module_info_SUITE.erl
+++ b/erts/emulator/test/module_info_SUITE.erl
@@ -23,7 +23,7 @@
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,
- exports/1,functions/1,deleted/1,native/1,info/1]).
+ exports/1,functions/1,deleted/1,native/1,info/1,nifs/1]).
%%-compile(native).
@@ -38,7 +38,7 @@ all() ->
modules().
modules() ->
- [exports, functions, deleted, native, info].
+ [exports, functions, deleted, native, info, nifs].
%% Should return all functions exported from this module. (local)
all_exported() ->
@@ -62,12 +62,24 @@ exports(Config) when is_list(Config) ->
All = lists:sort(?MODULE:module_info(exports)),
ok.
-%% Test that the list of exported functions from this module is correct.
+%% Test that the list of local and exported functions from this module is
+%% correct.
functions(Config) when is_list(Config) ->
All = all_functions(),
All = lists:sort(?MODULE:module_info(functions)),
ok.
+nifs(Config) when is_list(Config) ->
+ [] = ?MODULE:module_info(nifs),
+
+ %% erl_tracer is guaranteed to be present and contain these NIFs
+ TraceNIFs = erl_tracer:module_info(nifs),
+ true = lists:member({enabled, 3}, TraceNIFs),
+ true = lists:member({trace, 5}, TraceNIFs),
+ 2 = length(TraceNIFs),
+
+ ok.
+
%% Test that deleted modules cause badarg
deleted(Config) when is_list(Config) ->
Data = proplists:get_value(data_dir, Config),