diff options
author | Henrik Nord <henrik@erlang.org> | 2012-07-18 11:04:02 +0200 |
---|---|---|
committer | Henrik Nord <henrik@erlang.org> | 2012-07-18 11:04:02 +0200 |
commit | 154c00482d134260190127040ac6b4efb9f85a8f (patch) | |
tree | 9c09386fda97663f98a4bb5a5840df3d58f0b05f /lib/stdlib/test | |
parent | f82a553307c865440a01ff38e9b9d6482fe55550 (diff) | |
parent | 7875e98fcac4a45607a99ba08a421206a7cf1586 (diff) | |
download | otp-154c00482d134260190127040ac6b4efb9f85a8f.tar.gz otp-154c00482d134260190127040ac6b4efb9f85a8f.tar.bz2 otp-154c00482d134260190127040ac6b4efb9f85a8f.zip |
Merge branch 'ta/prim_archive-reloading' into maint
* ta/prim_archive-reloading:
escript_SUITE: remove gratuitous space
[erts,kernel,stdlib] fix escript/primary archive reloading
Conflicts:
erts/preloaded/src/erl_prim_loader.erl
OTP-10151
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/escript_SUITE.erl | 2 | ||||
-rw-r--r-- | lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 253b18ecb0..7b03fdafe3 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -358,7 +358,7 @@ beam_script(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Create an archive file containing two entire applications plus two %% alternate main modules. Generate a new escript containing the archive -%% (with .app and .beam files and ) and the escript header. +%% (with .app and .beam files and) and the escript header. archive_script(Config) when is_list(Config) -> %% Copy the orig files to priv_dir diff --git a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl index de56579998..431a51b0e5 100644 --- a/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl +++ b/lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl @@ -21,6 +21,8 @@ -export([main/1]). +-include_lib("kernel/include/file.hrl"). + -define(DUMMY, archive_script_dummy). -define(DICT, archive_script_dict). @@ -32,7 +34,7 @@ main(MainArgs) -> io:format("dummy:~p\n",[[E || E <- ErlArgs, element(1, E) =:= ?DUMMY]]), %% Start the applications - {error, {not_started, ?DICT}} = application:start(archive_script_dummy), + {error, {not_started, ?DICT}} = application:start(?DUMMY), ok = application:start(?DICT), ok = application:start(?DUMMY), @@ -57,4 +59,17 @@ main(MainArgs) -> ok = ?DICT:erase(Tab, Key), error = ?DICT:find(Tab, Key), ok = ?DICT:erase(Tab), + + %% Check mtime related caching bug with escript/primary archive files + Escript = escript:script_name(), + {ok, FileInfo} = file:read_file_info(Escript), + %% Modify mtime of archive file and try to reload module + FileInfo2 = FileInfo#file_info{mtime=calendar:now_to_local_time(now())}, + ok = file:write_file_info(Escript, FileInfo2), + Module = ?DICT, + {file, _} = code:is_loaded(Module), + true = code:delete(Module), + false = code:is_loaded(Module), + {module, Module} = code:ensure_loaded(Module), + ok. |