diff options
author | Björn Gustavsson <[email protected]> | 2016-09-15 10:16:28 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-15 10:16:28 +0200 |
commit | fde238fb52133a6c7a2a3f2a2e16f1c1bef62394 (patch) | |
tree | 0e553f298c23f508975635a121fbf8356c58ab8a /erts/emulator/test/nif_SUITE_data | |
parent | cebef1207eca1cdc8c601b172988a74fd0858efa (diff) | |
parent | 359e05121dab023585715b0e42506afd94f2e1f1 (diff) | |
download | otp-fde238fb52133a6c7a2a3f2a2e16f1c1bef62394.tar.gz otp-fde238fb52133a6c7a2a3f2a2e16f1c1bef62394.tar.bz2 otp-fde238fb52133a6c7a2a3f2a2e16f1c1bef62394.zip |
Merge branch 'bjorn/erts/on_load/ERL-240/OTP-13893' into maint
* bjorn/erts/on_load/ERL-240/OTP-13893:
erts: Add nif_SUITE:t_on_load
erts: Improve nif_SUITE:upgrade test
Don't leak old code when loading a modules with an on_load function
Diffstat (limited to 'erts/emulator/test/nif_SUITE_data')
-rw-r--r-- | erts/emulator/test/nif_SUITE_data/nif_mod.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.erl b/erts/emulator/test/nif_SUITE_data/nif_mod.erl index eec1bb8858..1fcc33faa4 100644 --- a/erts/emulator/test/nif_SUITE_data/nif_mod.erl +++ b/erts/emulator/test/nif_SUITE_data/nif_mod.erl @@ -29,6 +29,16 @@ -define(nif_stub,nif_stub_error(?LINE)). +-ifdef(USE_ON_LOAD). +-on_load(on_load/0). + +on_load() -> + [{data_dir, Path}] = ets:lookup(nif_SUITE, data_dir), + [{lib_version, Ver}] = ets:lookup(nif_SUITE, lib_version), + erlang:load_nif(filename:join(Path,libname(Ver)), []). + +-endif. + load_nif_lib(Config, Ver) -> load_nif_lib(Config, Ver, []). |