Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Ignore Code Coverage Line

Discussion in 'Testing & Automation' started by Ash-Blue, Mar 21, 2020.

  1. Ash-Blue

    Ash-Blue

    Joined:
    Aug 18, 2013
    Posts:
    102
    Is there a way to ignore code coverage on a file or line without messing with assembly files? I saw there was a tag called `[ExcludeFromCoverage]` but it doesn't seem to do anything. What I'd really like is an ignore comment system similar to Istanbul in order to maintain coverage on my open source projects. Sometimes I need to just ignore a single line.

    https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md
     
  2. Unity-Nikos

    Unity-Nikos

    Unity Technologies

    Joined:
    Sep 30, 2015
    Posts:
    87
    Hi @Ash-Blue

    I just came across your question.

    The Code Coverage package v1.0.0 has been released. This version includes support for ExcludeFromCoverage and ExcludeFromCodeCoverage attributes (added in version 0.4.0-preview/1.0.0-pre.1)