diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-06-09 14:37:15 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-06-09 14:37:15 +0200 |
commit | 2b48bda97f7773dea2bae6d2939bf74f9e6e10da (patch) | |
tree | 33aad3f7251231b6a9e9b60b64a63b97aa662e45 | |
parent | 18d74eec0a6035cadb97e6df381835682250a134 (diff) | |
download | otp-2b48bda97f7773dea2bae6d2939bf74f9e6e10da.tar.gz otp-2b48bda97f7773dea2bae6d2939bf74f9e6e10da.tar.bz2 otp-2b48bda97f7773dea2bae6d2939bf74f9e6e10da.zip |
cover: Unstick modules before loading remote
If not unstuck: faulty error messages will appear in error_logger_warn_SUITE.
-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. |