Skip to content
Browse files
Support running meck with modules built with '+deterministic' compile…
… option

When modules are built with '+deterministic' option, the BEAM files
don't have compile options available in the module_info/1:

    $ cat foo.erl
    $ erlc foo.erl
    $ erl -noshell -eval 'io:format("~p~n", [foo:module_info(compile)])' -run init stop
    $ rm foo.beam
    $ erlc +deterministic foo.erl
    $ erl -noshell -eval 'io:format("~p~n", [foo:module_info(compile)])' -run init stop

Running meck against these modules fail:


This commit fixes the problem.

Fixes eproxus/meck#184
  • Loading branch information
nablaa authored and eproxus committed Nov 27, 2017
1 parent a1f83d3 commit 32e62908a9670f316648e6a68467f3f177b81a61
Showing 1 changed file with 4 additions and 1 deletion.
@@ -123,5 +123,8 @@ load_binary(Name, Binary) ->
% module, and often are not always available when compiling the forms, so
% filter them out of the options
filter_options (Options) ->
lists:filter(fun({parse_transform,_}) -> false; (_) -> true end, Options).
case Options of
undefined -> [];
_ -> lists:filter(fun({parse_transform,_}) -> false; (_) -> true end, Options)

0 comments on commit 32e6290

Please sign in to comment.