diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-06-10 14:37:17 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-06-10 14:37:17 +0200 |
commit | d8f343b234174d49bc66d5bddbe79f24400868e6 (patch) | |
tree | b2aa2f5a1cbc976f773b39d5d703070894ae446b /lib/tools/src/cover.erl | |
parent | 455ae616947dce6bd6b514226e98b50ef176fd83 (diff) | |
parent | 2b48bda97f7773dea2bae6d2939bf74f9e6e10da (diff) | |
download | otp-d8f343b234174d49bc66d5bddbe79f24400868e6.tar.gz otp-d8f343b234174d49bc66d5bddbe79f24400868e6.tar.bz2 otp-d8f343b234174d49bc66d5bddbe79f24400868e6.zip |
Merge branch 'egil/fix-cover-error_logger/OTP-12818'
* egil/fix-cover-error_logger/OTP-12818:
cover: Unstick modules before loading remote
kernel: Add module name to sticky_dir error message
kernel: Remove ?line macros in error_logger_warn_SUITE
Diffstat (limited to 'lib/tools/src/cover.erl')
-rw-r--r-- | lib/tools/src/cover.erl | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 71e17e0ba1..3cffa093dc 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -1017,14 +1017,24 @@ load_compiled([{Module,File,Binary,InitialTable}|Compiled],Acc) -> %% Make sure the #bump{} records are available *before* the %% module is loaded. insert_initial_data(InitialTable), - NewAcc = - case code:load_binary(Module, ?TAG, Binary) of - {module,Module} -> - add_compiled(Module, File, Acc); - _ -> - do_clear(Module), - Acc - end, + Sticky = case code:is_sticky(Module) of + true -> + code:unstick_mod(Module), + true; + false -> + false + end, + NewAcc = case code:load_binary(Module, ?TAG, Binary) of + {module,Module} -> + add_compiled(Module, File, Acc); + _ -> + do_clear(Module), + Acc + end, + case Sticky of + true -> code:stick_mod(Module); + false -> ok + end, load_compiled(Compiled,NewAcc); load_compiled([],Acc) -> Acc. |