function_exported/3 and CT

Roberto Ostinelli ostinelli@REDACTED
Fri Nov 15 10:22:41 CET 2019


You were definitely right. Only change I've done is that instead of using
code:ensure_loaded/1 (which doesn't work in embedded mode, for the 3
people that use it in the world ^^_) I am using a simple catch
test_event_handler:module_info(exports) which seems to do the trick.

Thank you Jose,
r.


On Fri, Nov 15, 2019 at 10:20 AM Roberto Ostinelli <roberto@REDACTED>
wrote:

> You were definitely right. Only change I've done is that instead of using
> code:ensure_loaded/1 (which doesn't work in embedded mode, for the 3
> people that use it in the world ^^_) I am using a simple catch
> test_event_handler:module_info(exports) which seems to do the trick.
>
> Thank you Jose,
> r.
>
> On Thu, Nov 14, 2019 at 8:34 PM José Valim <
> jose.valim@REDACTED> wrote:
>
>> It is probably related to the module being loaded? function_exported/3
>> does not load modules and will return false if the module has not been
>> loaded yet. Something in rebar3 lifecycle may be loading it under certain
>> circumstances. Try calling code:ensure_loaded/1 before function_exported
>> and see if the behavior becomes consistent.--
>>
>>
>> *José Valim*
>> www.plataformatec.com.br
>> Founder and Director of R&D
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191115/aeb4982b/attachment.htm>


More information about the erlang-questions mailing list