aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorVlad Dumitrescu <[email protected]>2013-02-01 22:16:09 +0100
committerVlad Dumitrescu <[email protected]>2013-02-01 22:16:09 +0100
commitc14a046f40dee9915aa2d3d7d351bd80a630db61 (patch)
tree8b6693ec8bb329eabf4875898754061f846bb2a3 /lib/kernel/test
parent68b804f34d4ec420d86953e3f519179a40fbee8f (diff)
downloadotp-c14a046f40dee9915aa2d3d7d351bd80a630db61.tar.gz
otp-c14a046f40dee9915aa2d3d7d351bd80a630db61.tar.bz2
otp-c14a046f40dee9915aa2d3d7d351bd80a630db61.zip
Add a new function code:get_mode() can be used to detect how the code servers behaves
Rationale: Some applications (like erlide) have code to be loaded dynamically on a node. It may be slow to load everything upfront every time, so if the node is in interactive mode, we would like to just append to the load path. Currently, there is no direct way to detect if the node is running in embedded mode or not so that we can do the right thing.
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/code_SUITE.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index d7424c0c9a..4c040f0a0e 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -33,7 +33,7 @@
purge_stacktrace/1, mult_lib_roots/1, bad_erl_libs/1,
code_archive/1, code_archive2/1, on_load/1, on_load_binary/1,
on_load_embedded/1, on_load_errors/1, big_boot_embedded/1,
- native_early_modules/1]).
+ native_early_modules/1, get_mode/1]).
-export([init_per_testcase/2, end_per_testcase/2,
init_per_suite/1, end_per_suite/1,
@@ -60,7 +60,7 @@ all() ->
where_is_file_cached, purge_stacktrace, mult_lib_roots,
bad_erl_libs, code_archive, code_archive2, on_load,
on_load_binary, on_load_embedded, on_load_errors,
- big_boot_embedded, native_early_modules].
+ big_boot_embedded, native_early_modules, get_mode].
groups() ->
[].
@@ -1594,6 +1594,11 @@ native_early_modules_1(Architecture) ->
ok
end.
+get_mode(suite) -> [];
+get_mode(doc) -> ["Test that the mode of the code server is properly retrieved"];
+get_mode(Config) when is_list(Config) ->
+ interactive = code:get_mode().
+
%%-----------------------------------------------------------------
%% error_logger handler.
%% (Copied from stdlib/test/proc_lib_SUITE.erl.)