How can I use filter for emma when building Android test with ant for a library project?
Asked Answered
I

1

4

From this question :

How can I use filter for emma when building Android test with ant?

I know emma can use a filter by adding the following lines to my ant.properties of the targeted project, not the test project,

emma.filter=-com.your.excluded.package.*

but it seems it doesn't work properly if my target project is a library project.

My workspace looks like this:

projectlib1         : lib project using lib2
projectlib1/tests   : unit tests for lib1
projectlib2         : lib project using lib3
projectlib2/tests   : unit tests for lib2
projectlib3         : stand alone lib

When I run coverage for lib1 I also get coverage files for lib2 and lib3 which I do not want. Where should I add the emma.filter? I tried putting it at the root of each of those projects but it did not work so far.

any suggestion welcome! thank you

Idaline answered 20/9, 2012 at 5:12 Comment(0)
S
5

Just had the same problem, I tried the solution of the thread you mention and I did not work. I also tried to add it directly in the build.xml file, did not work either.

Although I managed to make it work by adding the -Demma.filter="-your.app.package" on the ant command line:

ant -Demma.filter="-your.app.package.to.exclude.*" emma debug install test
Skill answered 4/3, 2013 at 17:55 Comment(1)
thanks! I tried that )I think with the -D at the end) with no luck, but this time it worked perfectly. So, thanks.Ephebe

© 2022 - 2024 — McMap. All rights reserved.