mirror of
https://github.com/correl/rebar.git
synced 2024-11-14 11:09:35 +00:00
Fix deps path check in rebar_ct:collect_glob/3
Since rebar_deps:get_deps_dir/1 returns an absolute path, lists:member(Deps, Parts2) will always return false, thus .test.spec files in deps/ will not be ignored.
This commit is contained in:
parent
01ef314951
commit
a83c80d4c0
4 changed files with 11 additions and 2 deletions
1
THANKS
1
THANKS
|
@ -130,3 +130,4 @@ Drew Varner
|
|||
Roberto Aloi
|
||||
Luis Rascao
|
||||
Vlad Dumitrescu
|
||||
stwind
|
||||
|
|
|
@ -9,10 +9,16 @@ files() ->
|
|||
[{create, "ebin/foo.app", app(foo)},
|
||||
{copy, "../../rebar", "rebar"},
|
||||
{copy, "foo.test.spec", "foo.test.spec"},
|
||||
{copy, "deps/bar.test.spec", "deps/bar.test.spec"},
|
||||
{copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].
|
||||
|
||||
run(_Dir) ->
|
||||
{ok, _} = retest:sh("./rebar compile ct -vvv"),
|
||||
Ref = retest:sh("./rebar compile ct -vvv", [async]),
|
||||
{ok, [[CTRunCmd]]} = retest:sh_expect(Ref, "^\"ct_run.*",
|
||||
[global, {capture, first, binary}]),
|
||||
{match, _} = re:run(CTRunCmd, "foo.test.spec", [global]),
|
||||
%% deps/bar.test.spec should be ignored by rebar_ct:collect_glob/3
|
||||
nomatch = re:run(CTRunCmd, "bar.test.spec", [global]),
|
||||
ok.
|
||||
|
||||
%%
|
||||
|
|
1
inttest/ct2/deps/bar.test.spec
Normal file
1
inttest/ct2/deps/bar.test.spec
Normal file
|
@ -0,0 +1 @@
|
|||
%% this test spec should be ignored
|
|
@ -291,13 +291,14 @@ get_cover_config(Config, Cwd) ->
|
|||
|
||||
collect_glob(Config, Cwd, Glob) ->
|
||||
{true, Deps} = rebar_deps:get_deps_dir(Config),
|
||||
DepsDir = filename:basename(Deps),
|
||||
CwdParts = filename:split(Cwd),
|
||||
filelib:fold_files(Cwd, Glob, true, fun(F, Acc) ->
|
||||
%% Ignore any specs under the deps/ directory. Do this pulling
|
||||
%% the dirname off the F and then splitting it into a list.
|
||||
Parts = filename:split(filename:dirname(F)),
|
||||
Parts2 = remove_common_prefix(Parts, CwdParts),
|
||||
case lists:member(Deps, Parts2) of
|
||||
case lists:member(DepsDir, Parts2) of
|
||||
true ->
|
||||
Acc; % There is a directory named "deps" in path
|
||||
false ->
|
||||
|
|
Loading…
Reference in a new issue