How to generate coverage across three projects in Android?

Balu P April 10, 2013

I have three projects as part of the source code. First one of them is a dependent project and the other and the third one is depedent on the second one.

My question is what settings should I be doing for InitString on all three projects. I'm using Eclipse IDE and have these as Android projects.

I have provided custom initstring values for two of the projects. Code gets instrumented but "clover" directory would not get created in the path I gave for InitString.

Any help here would be highly appreciated!

11 answers

0 votes
Balu P April 29, 2013

Please answer my questions.

0 votes
Balu P April 24, 2013

> However, I don't see the folder that would contain the .db file on the device

1) Could you run it in emulator? I'd like to ensure that it's not a problem of the device itself.

Ans: I'm running the tests on a rooted device. My feeling is device should not be an issue here.

2) Have you disabled the per-test coverage feature? There's one known bug (CLOV-1194). Seehttps://answers.atlassian.com/questions/107086/error-message-arrayindexoutofbounds-with-clover-for-android

Ans: I'm running all the tests manually.

Another question: If I unplug the device and plug it in again through USB, will I get coverage for the tests ran manually before unplugging the device?

jjaroczynski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2013

1) Neverthless, could you run it in emulator?

2) Despite of running tests manually, Clover can still gather coverage per test. Please disable that feature.

3) Do you run tests using 'Run with Clover...'?

4) If you run tests before unpluging device then all coverage files should be generated correctly. Unplugin and plugin device should not affect them.

Regards,
Jacek

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 24, 2013

> However, I don't see the folder that would contain the .db file on the device

1) Could you run it in emulator? I'd like to ensure that it's not a problem of the device itself.

2) Have you disabled the per-test coverage feature? There's one known bug (CLOV-1194). See https://answers.atlassian.com/questions/107086/error-message-arrayindexoutofbounds-with-clover-for-android

0 votes
Balu P April 17, 2013

Questions:

- did you install Clover-for-Eclipse or Clover-for-Android?

Yes. I have installed.

- do you see c:\Temp\1.db, 2.db, 3.db files after project rebuild?

I see only two .db files.

- do you see any error messages in ErrorLog?

No. No error messages in the logs.

- why all three projects have the localCoverageDir=/data/data/com.intuit.quickbooks path? are all three projects named 'com.intuit.quickbooks' in AndroidManifest.xml?

Androidmanifest file has different setting in one project and same setting in tow other projects. Should I be giving the setting in the Andoirmanifest.xml file as the path for localcoverageDir? Please clarify

- what Java, Eclipse, ADT, OS version do you have?

Java-1.7

Eclipse-Indigo

0 votes
Balu P April 17, 2013

One more question: were you able to run Example #1 and #2 fromhttps://confluence.atlassian.com/display/CLOVER/Clover-for-Android ?

Yes. I ran both the examples successfully.

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2013

One more question: were you able to run Example #1 and #2 from https://confluence.atlassian.com/display/CLOVER/Clover-for-Android ?

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2013

I created three 'NotePad' projects, renamed them from 'com.example.android.notepad' to 'com.intuit.quickbooks' and used initstrings as specified by you. Clover databases were created in c:\Temp directory, it was also possible to start an application and record coverage data and next pull them into Eclipse and see coverage in an IDE. So it works fine on my side.

Questions:

- did you install Clover-for-Eclipse or Clover-for-Android?

- do you see c:\Temp\1.db, 2.db, 3.db files after project rebuild?

- do you see any error messages in ErrorLog?

- why all three projects have the localCoverageDir=/data/data/com.intuit.quickbooks path? are all three projects named 'com.intuit.quickbooks' in AndroidManifest.xml?

- what Java, Eclipse, ADT, OS version do you have?

0 votes
Balu P April 17, 2013

Request some help here!

0 votes
Balu P April 11, 2013

1st project: clover+remote:file:///c%3A%5CTemp%5C1.db?localCoverageDir=/data/data/com.intuit.quickbooks/clover1/

2nd project: clover+remote:file:///c%3A%5CTemp%5C2.db?localCoverageDir=/data/data/com.intuit.quickbooks/clover2/

3rd project: clover+remote:file:///c%3A%5CTemp%5C3.db?localCoverageDir=/data/data/com.intuit.quickbooks/clover3/

I'm using absolute path

If I enable clover on all three projects, clover directories are not getting created at all.

Please let me know if you need any further information.

Regarding single report, if I get dbs from all three projects above, I can combine them.

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2013

Regarding single report - it's possible to merge several Clover databases into one and generate a consolidated report. See <clover-merge/> Ant task for instance.

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2013

Could you paste exact initstring values used for all three projects?

Do you use relative or absolute path?

Do you use initstring in URI format?

You wrote that "clover" directory is not being created in the path specified for initstring. Is it created at all? Where?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events