From 359e05121dab023585715b0e42506afd94f2e1f1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 7 Sep 2016 17:11:03 +0200 Subject: erts: Add nif_SUITE:t_on_load --- erts/emulator/test/nif_SUITE_data/nif_mod.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'erts/emulator/test/nif_SUITE_data') 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, []). -- cgit v1.2.3