Skip to content

Commit

Permalink
Do not attempt to generate dependencies when mocking
Browse files Browse the repository at this point in the history
Fixed in #207
  • Loading branch information
jesperes committed Feb 5, 2020
1 parent 9753464 commit 9b3ce75
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/meck_code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,16 @@ load_binary(Name, Binary) ->
% Furthermore, since Erlang/OTP 20, a code may be compiled from core but
% still have abstract code, so we make sure to remove the from_core option
% as we always compile it as a form.
%
% The -MMD option (makedep_side_effect) needs to be removed, otherwise
% the compiler will attempt to generate a dependency file.
filter_options (Options) ->
case Options of
undefined -> [];
_ -> lists:filter(fun({parse_transform,_}) -> false; (from_core) -> false; (_) -> true end, Options)
_ -> lists:filter(
fun({parse_transform,_}) -> false;
(makedep_side_effect) -> false;
(from_core) -> false;
(_) -> true
end, Options)
end.

0 comments on commit 9b3ce75

Please sign in to comment.