[erlang-questions] Excluding Modules in eunit coverage (rebar)

Tuncer Ayaz tuncer.ayaz@REDACTED
Mon Aug 17 19:16:36 CEST 2015


On Thu, Aug 13, 2015 at 4:04 AM, Pagayon, Ruel wrote:
> Hi guys,
>
> I'm using rebar to execute my eunit tests, and I want some modules
> excluded from the coverage report (basically those that has been
> generated, etc). I can see that having a cover.spec file works only
> for common tests. Is there any way I can exclude modules in eunit as
> well?

Not that I'm aware of.

When we give ct_run a cover spec, it uses excl_mods as an argument in
the test_server_ctrl:cover_compile() call.

When using eunit, rebar_eunit calls cover:compile_beam/1, so we could
exclude modules there and skip analyzing them later as well.

That said, I'm not sure if it's a good idea to add something like
{eunit_cover_exclude_mods, []} to rebar.config.

Maybe we can change eunit to support a spec file too.

Fred, any opinion?



More information about the erlang-questions mailing list