Hi everyone

I discovered a way of getting the android code instrumented, using the
full source from google.

On the project Android.mk I added the line EMMA_INSTRUMENT:=true and
voilá, it instrumented the code. Now I'm facing problems to run the
instrumented code. Although emma.jar is inside the image and installed
correctly during emulator startup, I keep getting errors that indicate
that Android is not being able to find the classes provided by emma. I
tried to force the usage of emma library by adding on the test
manifest  <uses-library android:name="emma" /> but if I do that, it
does not allow me to install the test application because Android
thinks that emma library is missing.

Does anyone have any ideas that I could try to fix this problem. I
really think I'm near of solving this puzzle, but I could not find the
last part yet.

On May 11, 9:00 pm, Richard Cook <richardgc...@gmail.com> wrote:
> I as well am looking to understand how  o build an emma instrumented test.
> I am unable to find any information on EMMA through SDK or through the web.
>
> Maybe the three of us can pool our resources and keep this thread alive to
> a.) get noticed, b.) get some code coverage.
>
> For those catching on:http://emma.sourceforge.net/intro.htmlis the place to 
> download EMMA (I
> assume). It may also be included in the SDK, I haven't verified this. It may
> need to be modified to run with Android?
>
> The command lines above work for me, but no files are generated. I have
> added EMMA to the build path.
>
> Has anyone had any luck yet? I've also considered Clover as an alternative
> to generating reports, but I have no progress there either.
>
> 2009/5/10 天山雪 <xuey.b...@gmail.com>
>
>
>
> > 1. did you download and set classpath for emma.jar?
> > 2. after that, you could get coverage.ec file.
> > But it's not right file for coverage report in my test. Perhaps other
> > things need to be done.
> > currently I don't know how to get an emma instrumented build, which is
> > needed for coverage test.
>
> > On 5月8日, 下午7时19分, Deeps <l.prade...@gmail.com> wrote:
> > > I had been surfing for the past one month on this Code coverage. But
> > > its disappointing that there is no clear documentation on using EMMA
> > > code coverage for Android.
>
> > > case 1: I am trying to execute from Command prompt.
> > > I have sucessfully implemented instrumentation class for my
> > > application. I would like to go for code coverage. I executed the
> > > following command in the cmd line:
>
> > > adb shell am instrument -w -e coverage true com.android.app/
> > > android.test.InstrumentationTestRunner
>
> > > adb shell am instrument -w -e coverageFile /sdcard/codefile.ec
> > > com.android.app/android.test.InstrumentationTestRunner
>
> > > Also i have configured to run with sdcard.. I could see that all my
> > > test cases are executed but no coverage file is generated at '/
> > > sdcard'.
>
> > > case 2: I am trying to execute from eclipse.
> > > When i did all coverage configuration settings and try to run the
> > > application, it pops up a message saying,
> > > " No coverage data file has been written during this coverage session.
> > > Please make sure that your application does NOT include EMMA run time
> > > libraries or EMMA configurations.Do not terminate java process
> > > manually from Eclipse"
>
> > > Please do clarify my error.
>
> > > Is there a right solution to get the code coverage for Android
> > > applications...?
>
> > > Pradeepa

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to