5 Star 1 Fork 9

src-openEuler/erlang-meck

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
erlang-meck-0001-Workaround-for-Rebar-2.x.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
yaokai13 提交于 2020-08-29 18:23 . package init
From: Peter Lemenkov <[email protected]>
Date: Tue, 4 Jul 2017 16:57:00 +0300
Subject: [PATCH] Workaround for Rebar 2.x
Signed-off-by: Peter Lemenkov <[email protected]>
diff --git a/test/meck_tests.erl b/test/meck_tests.erl
index 270186c..401c466 100644
--- a/test/meck_tests.erl
+++ b/test/meck_tests.erl
@@ -1078,13 +1078,7 @@ cover_options_fail_({_OldPath, Src, Module}) ->
test_file(Module, Ext) ->
filename:join(test_dir(), atom_to_list(Module) ++ Ext).
-test_dir() ->
- case code:which(?MODULE) of
- Filename when is_list(Filename) ->
- filename:dirname(Filename);
- Atom when is_atom(Atom) ->
- error({test_dir_not_found, ?MODULE, Atom})
- end.
+test_dir() -> "../" ++ filename:dirname(?FILE).
test_include() -> filename:join(test_dir(), "include").
@@ -1098,14 +1092,14 @@ run_mock_no_cover_file(Module) ->
%% @doc Verify that passthrough calls _don't_ appear in cover
%% analysis.
no_cover_passthrough_test() ->
- {ok, _} = cover:compile("test/meck_test_module.erl"),
+ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")),
{ok, {meck_test_module, {0,3}}} = cover:analyze(meck_test_module, module),
passthrough_test([no_passthrough_cover]),
{ok, {meck_test_module, {0,3}}} = cover:analyze(meck_test_module, module).
%% @doc Verify that passthrough calls appear in cover analysis.
cover_passthrough_test() ->
- {ok, _} = cover:compile("test/meck_test_module.erl"),
+ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")),
?assertEqual({ok, {meck_test_module, {0,3}}},
cover:analyze(meck_test_module, module)),
passthrough_test([]),
@@ -1113,7 +1107,7 @@ cover_passthrough_test() ->
cover:analyze(meck_test_module, module)).
cover_path_test() ->
- {ok, _} = cover:compile("test/meck_test_module.erl"),
+ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")),
?assertEqual({ok, {meck_test_module, {0,3}}},
cover:analyze(meck_test_module, module)),
ok = meck:new(meck_test_module, [passthrough]),
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/erlang-meck.git
[email protected]:src-openeuler/erlang-meck.git
src-openeuler
erlang-meck
erlang-meck
master

搜索帮助