Skip to content

Commit

Permalink
Remove compatibility for R15 and R16
Browse files Browse the repository at this point in the history
Closes #198.
  • Loading branch information
eproxus committed Oct 8, 2018
1 parent 12572c1 commit 38b25cc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ otp_release:
- 19.3
- 18.3
- 17.5
- R16B03-1
- R15B03

script: rebar3 eunit
install:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ If you or your company use Meck and find it useful, [donations][liberapay] are g
[hex]: https://hex.pm/packages/meck
[hex version badge]: https://img.shields.io/hexpm/v/meck.svg?style=flat-square
[hex license badge]: https://img.shields.io/hexpm/l/meck.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-R15B03%20to%2021.0-blue.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-17%20-%2021-blue.svg?style=flat-square
[build tool]: https://img.shields.io/badge/build%20tool-rebar3-orange.svg?style=flat-square
[liberapay badge]: https://img.shields.io/liberapay/receives/eproxus.svg?logo=liberapay&style=flat-square

Expand Down
12 changes: 1 addition & 11 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{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, "^R", non_namespaced_types}, % used by meck
{platform_define, "^[0-9]+", namespaced_types} % used by hamcrest
]}.

{profiles, [
{test, [
{erl_opts, [
debug_info,
{platform_define, "^R(?!16B03)", cover_empty_compile_opts}
]},
{erl_opts, [debug_info]},
{cover_enabled, true},
{cover_opts, [verbose]}
]},
Expand Down
4 changes: 0 additions & 4 deletions src/meck_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@
%%% Definitions
%%%============================================================================

-ifdef(non_namespaced_types). % For older Erlang versions
-type meck_dict() :: dict().
-else.
-type meck_dict() :: dict:dict().
-endif.

-record(state, {mod :: atom(),
can_expect :: any | [{Mod::atom(), Ari::byte()}],
Expand Down
13 changes: 4 additions & 9 deletions test/meck_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1040,14 +1040,6 @@ cover_options_({_OldPath, Src, Module}) ->
% 2 instead of 3, as above
?assertEqual({ok, {Module, {2,0}}}, cover:analyze(Module, module)).

-ifdef(cover_empty_compile_opts).
-define(compile_options, []).
-else.
-define(compile_options, [
{i, test_include()},
{d, 'TEST', true}
]).
-endif.
cover_options_fail_({_OldPath, Src, Module}) ->
%% This may look like the test above but there is a subtle
%% difference. When `cover:compile_beam' is called it squashes
Expand All @@ -1066,7 +1058,10 @@ cover_options_fail_({_OldPath, Src, Module}) ->
proplists:delete(outdir, lists:sort(meck_code:compile_options(Module)))
),
{ok, _} = cover:compile_beam(Module),
?assertEqual(?compile_options, meck_code:compile_options(Module)),
?assertEqual(
[{i, test_include()}, {d, 'TEST', true}],
meck_code:compile_options(Module)
),
a = Module:a(),
b = Module:b(),
{1, 2} = Module:c(1, 2),
Expand Down

0 comments on commit 38b25cc

Please sign in to comment.