junitcode-coverageclovertest-coverage

How can I designate lines of code for Clover to ignore?


I would like to tell Clover to ignore particular lines of my Java code. Is there any way to do so from within the code?

Something like

//// IGNORE vvvvvvv
System.out.println("Ignore this line and considered it covered");
//// IGNORE ^^^^^^^

If not, is there a clean way to do so by providing a context descriptor from outside the code?


Solution

  • you can use:

    //CLOVER:OFF
    //CLOVER:ON
    

    Here's official doc about it