We are Evaluating Clover for code coverage for future puchase and want to use the exclude files option. But it is not working.

I wanted to exclude certain files/packages from getting instrumented in clover.

Used following different entries in build.xml

<clover-setup>
<files>
<patternset>
<exclude name="**/*Utils.java"/>
</patternset>
</files>
</clover-setup>
and
<clover-setup>
<files excludes="com/test/project/web/utils/Utils.java, **/test/project/web/utils/**" />
</clover-setup>

But the file Utils.java and others in the package are still getting instrumented.

Using Cloverfor ant version 3.1.4.

2 answers

1 accepted

Accepted Answer
0 votes

Hi Anuj!

I'm a little late to answer I was just dealing with the same problem that you did. I also use the correct excludes and it was instrumenting every class.

The problem was that I was using ant or antcall, just add to the call the property "inheritrefs" in "true".

&lt;ant target="build" inheritrefs="true" /&gt;

Hope this helps!

Regards,

Gabriel

0 votes
There is also another way to define:
<clover-setup>
<files>
<exclude name="**/*EmcUtils.java"/>
</files>
</clover-setup>
ALL three versions work correctly. So I guess you must be calling wrong Ant targets (e.g having clover-instrument defined as well).

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 4 hours ago in Canada

TOPIC TUESDAY - Fav Scary Monster!

Hey folks and happy Topic Tuesday! In the spirit of Halloween and all things scary, today's topic is what is your favourite horror movie monster. My personal choice here would be Jason from the Frida...

8 views 0 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you