Search code examples
javaeclipseemma

Is it possible to get Emma coverage tool in eclipse to ignore certain lines?


I'm using Emma coverage tool in eclipse when using unit tests to see my coverage for each test. However certain lines don't get covered for instant the class declaration in an abstract class:

public abstract class ... {

Is it possible to either get Emma to cover this line or - preferably - ignore it?

Thanks, Alexei Blue.


Solution

  • Emma already ignores lines that can't be reached, such as class declarations. they are not marked as covered, but also don't count to the overall lines.

    i just verified it with this code:

    import junit.framework.TestCase;
    public class Test extends TestCase {
    
        public void testSomething() {
    
            assertTrue(new Check().check());
        }   
    }
    abstract class AbstractCheck {
    
        protected abstract boolean check();
    }
    class Check extends AbstractCheck {
    
        @Override
        protected boolean check() {
            return true;
        }
    }
    

    it returns 100% coverage.