couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [33/50] meck commit: updated refs/heads/master to dde7590
Date Thu, 31 Jul 2014 21:31:27 GMT
Fix changed cover compile opts 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/3e8de7e1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-meck/tree/3e8de7e1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-meck/diff/3e8de7e1

Branch: refs/heads/master
Commit: 3e8de7e17d8cbaff59d78d4cb628812e10719243
Parents: d2dcbba
Author: Adam Lindberg <hello@alind.io>
Authored: Fri Mar 14 18:42:00 2014 +0100
Committer: Adam Lindberg <hello@alind.io>
Committed: Fri Mar 14 18:42:00 2014 +0100

----------------------------------------------------------------------
 test.config         | 5 ++++-
 test/meck_tests.erl | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-meck/blob/3e8de7e1/test.config
----------------------------------------------------------------------
diff --git a/test.config b/test.config
index f9f6c33..59a2550 100644
--- a/test.config
+++ b/test.config
@@ -5,7 +5,10 @@
 
 %% Compiler Options ===========================================================
 % FIXME: Add warnings_as_errors once Hamcrest is fixed
-{erl_opts, [debug_info]}.
+{erl_opts, [
+    debug_info,
+    {platform_define, "R14|R15|R16(B0[1-2])?", cover_empty_compile_opts}
+]}.
 
 %% Eunit Options ==============================================================
 {cover_enabled, true}.

http://git-wip-us.apache.org/repos/asf/couchdb-meck/blob/3e8de7e1/test/meck_tests.erl
----------------------------------------------------------------------
diff --git a/test/meck_tests.erl b/test/meck_tests.erl
index 901ab84..3f472a2 100644
--- a/test/meck_tests.erl
+++ b/test/meck_tests.erl
@@ -986,6 +986,11 @@ cover_options_({_OldPath, Src, Module}) ->
     % 2 instead of 3, as above
     ?assertEqual({ok, {Module, {2,0}}}, cover:analyze(Module, module)).
 
+-ifndef(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
@@ -997,7 +1002,7 @@ 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)),
+    ?assertEqual(?compile_options, meck_code:compile_options(Module)),
     a      = Module:a(),
     b      = Module:b(),
     {1, 2} = Module:c(1, 2),


Mime
View raw message