diff options
author | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2016-01-13 21:09:05 -0800 |
---|---|---|
committer | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2016-01-13 21:09:05 -0800 |
commit | 6d8559cc0c77d0e2a7043ba042ca9c022a631393 (patch) | |
tree | 50671bcdbecf77ca3f147fe98e18d41668b71f8a /src | |
parent | 81efc493e1ad65da4c321b0569b2bb068c3bb4db (diff) |
change detection of valid modules for `eunit`
`beam_lib:chunks(..)` needs a path to object code which, frustratingly,
`code:which/1` won't return for cover compiled modules. instead just
assume that if `code:which/1` doesn't return `non_existing` a module
is something we can run tests on
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_eunit.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl index f75c4a5..a0c5dcc 100644 --- a/src/rebar_prv_eunit.erl +++ b/src/rebar_prv_eunit.erl @@ -333,10 +333,9 @@ validate_file(State, File) -> end. validate_module(_State, Module) -> - Path = code:which(Module), - case beam_lib:chunks(Path, [exports]) of - {ok, _} -> ok; - {error, beam_lib, _} -> {error, lists:concat(["Module `", Module, "' not found in project."])} + case code:which(Module) of + non_existing -> {error, lists:concat(["Module `", Module, "' not found in project."])}; + _ -> ok end. resolve_eunit_opts(State) -> |