Skip to content

Disable doctest in coverage #1372

@ghost

Description

Whilst testing the sbt-scoverage plugin for scala.js on the cats code, I noticed that there was greater test coverage in JVM. Turns out that this is because doctest is currently jvm only and there is some code that is not tested in the real tests, but happen to be called in doctest where the methods are in a comment. E.g. Bifunctor.leftWiden and all of Choice. About 1% of tests are like this.

So doctest should be disabled in coverage, so that the proper test coverage is measured. It could be that the doctest really tests the code, but more likely is just an example of usage.

OTOH.. @andyscott recently had a PR #1352 with two lines missed

Turns out this a bug in scoverage-scalac-plugin as it currently "detects" macro implementations by looking at methods that return an Expr, and here a Tree is returned. So actually, the whole macro method should be excluded, but currently is included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions