You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/07/31 23:31:20 UTC
[26/50] meck commit: updated refs/heads/master to dde7590
Make test pass on R16B03+
Project: http://git-wip-us.apache.org/repos/asf/couchdb-meck/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-meck/commit/c6bcda61
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-meck/tree/c6bcda61
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-meck/diff/c6bcda61
Branch: refs/heads/master
Commit: c6bcda61252d5e7578995024acf3fa2ba0ef9c2c
Parents: 7e4bcc4
Author: Adam Lindberg <he...@alind.io>
Authored: Fri Mar 14 14:31:14 2014 +0100
Committer: Adam Lindberg <he...@alind.io>
Committed: Fri Mar 14 14:31:14 2014 +0100
----------------------------------------------------------------------
rebar.config | 6 +++++-
test/meck_tests.erl | 9 ++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-meck/blob/c6bcda61/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
index 7a5569e..1eab0d2 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,5 +1,9 @@
%% Compiler Options ===========================================================
-{erl_opts, [warnings_as_errors, debug_info]}.
+{erl_opts, [
+ warnings_as_errors,
+ debug_info,
+ {platform_define, "(R14|R15|R16(?!B03))", cover_squash_comiple_opts}
+]}.
%% Misc =======================================================================
{clean_files, [".eunit", "ebin/*.beam", "test/*.beam"]}.
http://git-wip-us.apache.org/repos/asf/couchdb-meck/blob/c6bcda61/test/meck_tests.erl
----------------------------------------------------------------------
diff --git a/test/meck_tests.erl b/test/meck_tests.erl
index 901ab84..4168a6c 100644
--- a/test/meck_tests.erl
+++ b/test/meck_tests.erl
@@ -986,6 +986,12 @@ cover_options_({_OldPath, Src, Module}) ->
% 2 instead of 3, as above
?assertEqual({ok, {Module, {2,0}}}, cover:analyze(Module, module)).
+-ifdef(cover_squash_compile_opts).
+-define(copts, []).
+-else.
+-define(copts, [{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
@@ -997,7 +1003,8 @@ cover_options_fail_({_OldPath, Src, Module}) ->
{ok, _} = compile:file(Src, CompilerOptions),
?assertEqual(CompilerOptions, meck_code:compile_options(Module)),
{ok, _} = cover:compile_beam(Module),
- ?assertEqual([], meck_code:compile_options(Module)),
+ io:format(user, "Copts: ~p~n", [?copts]),
+ ?assertEqual(?copts, meck_code:compile_options(Module)),
a = Module:a(),
b = Module:b(),
{1, 2} = Module:c(1, 2),