Hi guys,

I don't know if this thread is still active, but I spent some hours
trying to make the EMMA instrumented code generation works.

I actually came pretty close of getting it, I think. You can use the
EMMA_INSTRUMENT:=true on the project Android.mk file to turn on the
EMMA instrumentation for that project. Everything seems to work, but
at the end I get a bizarre error on Calendar Tests:


target Java: Calendar (out/target/common/obj/APPS/
Calendar_intermediates/classes)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
EMMA: processing instrumentation path ...
EMMA: instrumentation path processed in 703 ms
EMMA: [119 class(es) instrumented, 11 resource(s) copied]
EMMA: metadata merged into [/work/android3/out/target/common/obj/APPS/
Calendar_intermediates/coverage.em] {in 51 ms}
Copying: out/target/common/obj/APPS/Calendar_intermediates/classes.jar
target Dex: Calendar

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.code.SimException: local variable type mismatch:
attempt to set or access a value of type java.lang.String[] using a
local variable of type java.lang.String. This is symptomatic of .class
transformation tools that ignore local variable information.
        at com.android.dx.cf.code.BaseMachine.throwLocalMismatch
(BaseMachine.java:537)
        at com.android.dx.cf.code.BaseMachine.getLocalTarget(BaseMachine.java:
392)
        at com.android.dx.cf.code.BaseMachine.storeResults(BaseMachine.java:
519)
        at com.android.dx.cf.code.ValueAwareMachine.run
(ValueAwareMachine.java:196)
        at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:290)
        at com.android.dx.cf.code.Simulator$SimVisitor.visitLocal
(Simulator.java:542)
        at com.android.dx.cf.code.BytecodeArray.parseInstruction
(BytecodeArray.java:472)
        at com.android.dx.cf.code.Simulator.simulate(Simulator.java:96)
        at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:681)
        at com.android.dx.cf.code.Ropper.doit(Ropper.java:636)
        at com.android.dx.cf.code.Ropper.convert(Ropper.java:253)
        at com.android.dx.dex.cf.CfTranslator.processMethods
(CfTranslator.java:252)
        at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:
131)
        at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
        at com.android.dx.command.dexer.Main.processClass(Main.java:297)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
        at com.android.dx.command.dexer.Main.access$100(Main.java:56)
        at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:
228)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive
(ClassPathOpener.java:245)
        at com.android.dx.cf.direct.ClassPathOpener.processOne
(ClassPathOpener.java:130)
        at com.android.dx.cf.direct.ClassPathOpener.process
(ClassPathOpener.java:108)
        at com.android.dx.command.dexer.Main.processOne(Main.java:245)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
        at com.android.dx.command.dexer.Main.run(Main.java:139)
        at com.android.dx.command.dexer.Main.main(Main.java:120)
        at com.android.dx.command.Main.main(Main.java:87)
...at bytecode offset 000000b7
locals[0000]: Lcom/google/android/googleapps/IGoogleLoginService$Stub;
locals[0001]: I
locals[0002]: Landroid/os/Parcel;
locals[0003]: Landroid/os/Parcel;
locals[0004]: I
locals[0005]: <invalid>
locals[0006]: <invalid>
locals[0007]: <invalid>
locals[0008]: <invalid>
locals[0009]: [Z
...while working on block 00b7
...while working on method onTransact:(ILandroid/os/Parcel;Landroid/os/
Parcel;I)Z
...while processing onTransact (ILandroid/os/Parcel;Landroid/os/
Parcel;I)Z
...while processing com/google/android/googleapps/IGoogleLoginService
$Stub.class

1 error; aborting


Really strange error. I'll keep trying to find out how to fix this.

Thanks

Felipe


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