mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Merge pull request #406 from stwind/master
Fix deps path check in rebar_ct:collect_glob/3
This commit is contained in:
commit
6584defdda
4 changed files with 11 additions and 2 deletions
1
THANKS
1
THANKS
|
@ -130,3 +130,4 @@ Drew Varner
|
||||||
Roberto Aloi
|
Roberto Aloi
|
||||||
Luis Rascao
|
Luis Rascao
|
||||||
Vlad Dumitrescu
|
Vlad Dumitrescu
|
||||||
|
stwind
|
||||||
|
|
|
@ -9,10 +9,16 @@ files() ->
|
||||||
[{create, "ebin/foo.app", app(foo)},
|
[{create, "ebin/foo.app", app(foo)},
|
||||||
{copy, "../../rebar", "rebar"},
|
{copy, "../../rebar", "rebar"},
|
||||||
{copy, "foo.test.spec", "foo.test.spec"},
|
{copy, "foo.test.spec", "foo.test.spec"},
|
||||||
|
{copy, "deps/bar.test.spec", "deps/bar.test.spec"},
|
||||||
{copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].
|
{copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].
|
||||||
|
|
||||||
run(_Dir) ->
|
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.
|
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) ->
|
collect_glob(Config, Cwd, Glob) ->
|
||||||
{true, Deps} = rebar_deps:get_deps_dir(Config),
|
{true, Deps} = rebar_deps:get_deps_dir(Config),
|
||||||
|
DepsDir = filename:basename(Deps),
|
||||||
CwdParts = filename:split(Cwd),
|
CwdParts = filename:split(Cwd),
|
||||||
filelib:fold_files(Cwd, Glob, true, fun(F, Acc) ->
|
filelib:fold_files(Cwd, Glob, true, fun(F, Acc) ->
|
||||||
%% Ignore any specs under the deps/ directory. Do this pulling
|
%% Ignore any specs under the deps/ directory. Do this pulling
|
||||||
%% the dirname off the F and then splitting it into a list.
|
%% the dirname off the F and then splitting it into a list.
|
||||||
Parts = filename:split(filename:dirname(F)),
|
Parts = filename:split(filename:dirname(F)),
|
||||||
Parts2 = remove_common_prefix(Parts, CwdParts),
|
Parts2 = remove_common_prefix(Parts, CwdParts),
|
||||||
case lists:member(Deps, Parts2) of
|
case lists:member(DepsDir, Parts2) of
|
||||||
true ->
|
true ->
|
||||||
Acc; % There is a directory named "deps" in path
|
Acc; % There is a directory named "deps" in path
|
||||||
false ->
|
false ->
|
||||||
|
|
Loading…
Reference in a new issue