mirror of
https://github.com/correl/rebar.git
synced 2025-04-10 01:01:08 -09:00
beam_lib:chunks needs abs path to beam.
Uses code:which or cover:is_compiled to get path the beam for chunks
This commit is contained in:
parent
688430fac0
commit
e4772c0763
1 changed files with 8 additions and 1 deletions
|
@ -280,7 +280,14 @@ has_eunit_test_fun(Mod) ->
|
||||||
F == test]) =/= 0.
|
F == test]) =/= 0.
|
||||||
|
|
||||||
has_header(Mod, Header) ->
|
has_header(Mod, Header) ->
|
||||||
{ok, {_, [{abstract_code, {_, AC}}]}} = beam_lib:chunks(Mod, [abstract_code]),
|
Mod1 = case code:which(Mod) of
|
||||||
|
cover_compiled ->
|
||||||
|
{file, File} = cover:is_compiled(Mod),
|
||||||
|
File;
|
||||||
|
undefined -> Mod;
|
||||||
|
L -> L
|
||||||
|
end,
|
||||||
|
{ok, {_, [{abstract_code, {_, AC}}]}} = beam_lib:chunks(Mod1, [abstract_code]),
|
||||||
length([F || {attribute, 1, file, {F, 1}} <- AC,
|
length([F || {attribute, 1, file, {F, 1}} <- AC,
|
||||||
string:str(F, Header) =/= 0]) =/= 0.
|
string:str(F, Header) =/= 0]) =/= 0.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue