Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update meck for OTP 18.0 #139

Merged
merged 2 commits into from
Apr 1, 2015
Merged

Conversation

gomoripeti
Copy link
Contributor

In order to avoid creating temporary files meck_cover needs direct
access to some unexported functions of cover.
In OTP 18.0 the internal API of cover changed a bit and
compile_beam/2 (which allows passing a binary instead just a filename)
was replaced by compile_beams/1.

See erlang/otp@ab435488

Travis does not have OTP 18.0-rc1 yet but the unit tests pass on my machine
(with the namespaced types change)

@@ -1,7 +1,7 @@
%% Compiler Options ===========================================================
{erl_opts, [
%% Erlang releases after 17 don't put R in front of their name, and also require dict() to be written like dict:dict()
{platform_define, "^[0-9]+", namespaced_dicts},
{platform_define, "^[0-9]+", namespaced_types},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a functional reason for renaming namespaced_dicts to namespaced_types? (Apart from that it looks better?) 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it does look a bit better :) but this is actually needed for meck_tests.erl to compile in 18.0 (those non-namespaced types are completely removed now). I tried to explain it in the commit message but let me know if I should make it clearer.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you mean the define is needed, and the new name better describes it (because it is more general)? If so, then keep the change. 😄

Péter Gömöri added 2 commits March 31, 2015 21:01
Meck used to have 'namespaced_dict' while Hamcrest recently introduced
a similar macro, 'namespaced_types' for the same purpose.
In OTP 18.0 the affected non-namespaced types were completely removed and
using them results in a compile error instead of deprecation wagning in 17.
So hamcrest.hrl relies on the precense of 'namespaced_types' macro
to use the right type. Meck's test module meck_tests.erl includes this header
so the 'namespaced_types' macro also have to be defined in meck's test.config.
To eliminate duplication I chose to unite the above two macros and
use the more generic 'namespaced_types' name.
In order to avoid creating temporary files meck_cover needs direct
access to some unexported functions of cover.
In OTP 18.0 the internal API of cover changed a bit and
compile_beam/2 (which allows passing a binary instead just a filename)
was replaced by compile_beams/1.

See erlang/otp@ab435488
@gomoripeti
Copy link
Contributor Author

updated the code as agreed and extended the description of commit msq gomoripeti/meck@79cb5c9

@eproxus
Copy link
Owner

eproxus commented Apr 1, 2015

Brilliant, thanks!

eproxus added a commit that referenced this pull request Apr 1, 2015
@eproxus eproxus merged commit fa3cd97 into eproxus:master Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants