aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/code_SUITE.erl
AgeCommit message (Collapse)Author
2016-01-28code: Correct the types for error returnsBjörn Gustavsson
The specifications for functions that load code in the 'code' module (e.g. code:load_file/1) have some problems: * The specs claim that the functions can return {error,on_load}, but they never do. However, they can return {error,on_load_failure} if the -on_load function in a module fails. * The specs claim that the functions can return {error,native_code}, but they never do. While we are it, also extend the on_load_errors/1 test case to test that the load functions return {error,on_load_failure} when an -on_load function fails.
2016-01-27code_server: Don't export internal system_* functionsBjörn Gustavsson
There is no reason to export system_continue/3 and system_terminate/4 from code_server. Servers that use proc_lib and 'sys' to handle system message do need those functions exported, but code_server contains a modified copy of the system message handling code from 'sys', and that code only make local calls to system_continue/3 and system_terminate/4.
2016-01-25Eliminate run-time system crash in code:load_abs/1Björn Gustavsson
The run-time system would terminate if code:load_abs/1 was called with a filename containing any non-latin1 characters. The reason is that code_server would attempt to construct a module name from the filename using list_to_atom/1 and that atoms currently are limited to the latin1 character set. But how should the error be reported? I have decided to that the simplest and least confusing way is to move the call to list_to_atom/1 to 'code' module and let it crash the calling process. The resulting stack back trace will make it clear what the reason for the crash was.
2016-01-13erts: Make erlang:purge_module/1 safeSverker Eriksson
Problem: erlang:purge_module/1 is not safe in the sense that very bad things may happen if the code to be purged is still referred to by live processes. Introduce erts_internal:purge_module which is the same as the old erlang:purge_module BIF (except it returns false if no such old module). Implement erlang:purge_module in Erlang and let it invoke erts_code_purger for safe purging where all clogging processes first are killed.
2016-01-13erts: Refactor code:purge/1 and code:soft_purge/1Sverker Eriksson
by moving code from code_server to erts_code_purger. This is more or less a copy-paste from code_server.erl to erts_code_purger.erl. All the inner mechanics of code:purge/1 and code:soft_purge/1 are unchanged.
2015-12-14Remove the code path cache in the code serverBjörn Gustavsson
In practice, it does not seem that code path cache can improve performance. Looking for any file that is not found will cause the cache to be rebuilt, which will negate any gain of using the cache.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-04Update list of funcalls in kernel code_SUITERichard Carlsson
2015-05-28Merge branch 'richcarl/warnings-by-default/OTP-12781'Björn-Egil Dahlberg
* richcarl/warnings-by-default/OTP-12781: stdlib: Use warning channel in test qlc_SUITE:otp_6964/1 stdlib: Fix testcase for qlc_SUITE kernel: Fix code_SUITE with respect to new logger default Map error logger warnings to warning messages by default
2015-05-27kernel: Fix code_SUITE with respect to new logger defaultBjörn-Egil Dahlberg
2015-04-30kernel: Use module erl_annoHans Bolinder
2014-06-04Make pre-loaded modules permanently stickyBjörn Gustavsson
Modules in the kernel, stdlib, and compiler applications are by default "sticky", meaning that the code server will refuse to re-load them. The pre-loaded modules (those that are part of the run-time system itself, such as 'erlang') are, however, not sticky. They used to be sticky a long time ago when the pre-loaded modules were part of the kernel application. Now they are part of the erts application. Since re-loading a pre-loaded module can be catastrophic (especially re-loading the 'erlang' module), the pre-loaded modules must be sticky. Furthermore, it should not be allowed to unstick them. The sticky_dir/1 test case in code_SUITE is never actually run and is broken. Rewrite it.
2014-05-26Teach code:del_path/1 to ignore superfluous slashesBjörn Gustavsson
The following sequence will NOT leave the code path unchanged: code:add_path("/some/app/"), . . . code:del_path("/some/app/") The reason is that code:add_path/1 will normalize the path name (removing the trailing slash), while code:del_path/1 does not normalize the path before searching for it in the code path.
2014-01-21kernel: code_SUITE fix unicode optionBjörn-Egil Dahlberg
2014-01-21Fix testing with unicode pathsDan Gudmundsson
re needs unicode option
2013-11-18Parallel check_process_code when code_server purge a moduleRickard Green
When the code_server is about to purge a module it will now issue asynchronous check_process_code requests to all processes at once instead of one at a time. These check_process_code operation can execute in parallel.
2013-07-11Refactor away ?line macro in code_SUITEBjörn-Egil Dahlberg
2013-07-11Fix tests for erts app-fileBjörn-Egil Dahlberg
2013-02-22Update copyright yearsBjörn-Egil Dahlberg
2013-02-20Merge branch 'ks/hipe_bif-remove_refs_from/OTP-10851'Fredrik Gustafsson
* ks/hipe_bif-remove_refs_from/OTP-10851: Fixed test to allow for lists:foreach/2 call Change the return value of hipe_bifs:remove_refs_from/1
2013-02-19Fixed test to allow for lists:foreach/2 callKostis Sagonas
2013-02-18erts: Fix code:is_module_nativeSverker Eriksson
code:is_module_native returned false for hipe compiled module if the first function in the module was a BIF stub
2013-02-01Add a new function code:get_mode() can be used to detect how the code ↵Vlad Dumitrescu
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.
2012-10-30Use code:lib_dir instead of code:which to get application directorySiri Hansen
code_SUITE:ext_mod_dep used code:which(kernel) to get the path to the kernel ebin directory. This failed when kernel was cover compiled, since code:which then returns 'cover_compiled'. Using code:lib_dir instead solved the problem.
2012-08-23Merge branch 'maint'Sverker Eriksson
Conflicts: erts/preloaded/ebin/init.beam
2012-08-21kernel: Disable hipe compilation for hipe_unified_loaderSverker Eriksson
Workaround for crash in code_server.
2012-07-19kernel: Remove VxWorks from testsBjörn-Egil Dahlberg
2012-06-12Add kernel/test/code_SUITE:upgradeSverker Eriksson
For now we only test beam as hipe doesn't pass the test
2012-06-05Update to work with whitespace in exec pathLukas Larsson
OTP-10106 OTP-10107
2012-03-30Update copyright yearsBjörn-Egil Dahlberg
2012-03-21Teach big_boot_embedded testcase about comtePatrik Nyblom
2012-01-23Fix on_load handling in modules loaded by code:load_binary/3Björn Gustavsson
In "13.4 Running a function when a module is loaded" in the Reference Manual, it is said that: A process that calls any function in a module whose on_load function has not yet returned will be suspended until the on_load function has returned. That did not work if the module was loaded using code:load_binary/3. Instead, the callers would get an 'undef' exception.
2011-09-29Merge branch 'dev' into majorLukas Larsson
* dev: Skip create_big_boot on platforms without crypto Remove test_server path instead of cwd for clash test Skip getaddr_v6 test if on the ipv4_only host Use static port for old solaris versions Extend time to wait for zone files to be loaded Allow out of memory exception for max_port checks Extend slave start timeout for windows tests Double timeout to make sure debug builds pass Use now instead of os:timestamp Increase timeout in scheduler_suspend for slow platforms Skip update_cpu_info if 'taskset' cannot be found
2011-09-29Skip create_big_boot on platforms without cryptoLukas Larsson
This has to be done as many other applications depend on that crypto is present.
2011-09-29Remove test_server path instead of cwd for clash testLukas Larsson
With the introduction of common_test as test framework the working directory of the tests changed to be the emulator_test directory. So we now have to remove the ../test_server directory instead. This change only affect tests run with a emulator which has not been installed.
2011-09-02Merge branch 'dev' into majorHans Bolinder
* dev: Fix a couple of minor bugs with hook priority Update to reflect addition of CTH priority addition Update CTH priority default to be 0 Update to reflect new cth callback api Update the return from init/2 to be {ok, NewState} or {ok,NewState,Priority} instead of NewState. Add priority functionality and tests for ct hooks Update internal hooks state to use a record instead of tuples Improve and correct types and specifications in Kernel and STDLIB
2011-08-31Improve and correct types and specifications in Kernel and STDLIBHans Bolinder
Running Dialyzer on the test suites revealed a few type errors.
2011-08-16emulator: Add a fourth element in exception stacktracesBjörn Gustavsson
This commit is a preparation for introducing location information (filename/line number) in stacktraces in exceptions. Currently a stack trace looks like: [{Mod1,Function1,Arity1}, . . . {ModN,FunctionN,ArityN}] Add a forth element to each tuple that can be used indication the filename and line number of the source file: [{Mod1,Function1,Arity1,Location1}, . . . {ModN,FunctionN,ArityN,LocationN}] In this commit, the fourth element will just be an empty list, and we will change all code that look at or manipulate stacktraces.
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2011-02-17Rename Suite Callback to Common Test HookLukas Larsson
2011-02-17Fix formatting for kernelLukas Larsson
2011-02-17Add ts_install_scb to suite/0Lukas Larsson
2011-02-17Update kernel tests to conform with common_test standardLukas Larsson
2011-02-17Update all fin_per_testcase to end_per_testcase.Lukas Larsson
2010-12-01Mend on_load_embedded testcase which did not handle windows linksPatrik Nyblom
2010-11-30Corrected testcases broken by unicode filenamesPatrik Nyblom
Also corrected type-info for bifs
2010-11-29Merge branch 'pan/embedded-mode-testcase/OTP-8905' into devPatrik Nyblom
* pan/embedded-mode-testcase/OTP-8905: Unload stray applications from application_SUITE before creating script Make testcase filter away bogus applications from earlier suites Add test loading all of OTP in boot script and running embedded
2010-11-26Unload stray applications from application_SUITE before creating scriptPatrik Nyblom
2010-11-25Make testcase filter away bogus applications from earlier suitesPatrik Nyblom
2010-11-25Add test loading all of OTP in boot script and running embeddedPatrik Nyblom