Skip to main content

Emma code coverage

4 replies [Last post]
santoshcv
Offline
Joined: 2010-12-21
Points: 0

Followed the instructions from https://devzone.cablelabs.com/widget/web/ocapri/1/-/wiki/OCAP%20RI%20Pub...
But couldn't get the coverage working, I get following error attempting to generate report :
$ java -cp $OCAPROOT/tools/generic/emma/emma.jar emma ctl -c coverage.get,,true
,false
EMMA: processing control command sequence ...
EMMA: executing [coverage.get (coverage.ec,true,false)] ...
[EMMA v2.1, build 5320 (stable)]
emma ctl: coverage.get: RPC failure while executing [coverage.get]
Exception in thread "main" com.vladium.emma.EMMARuntimeException: coverage.get:
RPC failure while executing [coverage.get]
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:242)
at com.vladium.emma.Processor.run(Processor.java:88)
at com.vladium.emma.ctl.ctlCommand.run(ctlCommand.java:151)
at emma.main(emma.java:50)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
I see that the classes get instrumented, there is coverage.em file generated in RI_Platform folder when RI is started, but I didn't see coverage.ec file.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
spetrakos
Offline
Joined: 2010-12-10
Points: 0

Please enter the exact sequence of steps to reproduce this bug. So far I have been unable to reproduce. Thanks.

santoshcv
Offline
Joined: 2010-12-21
Points: 0

I'm using Emma version emma-stable-2.1.5320-lib.zip.

  1. emma.jar to the build.test.CLASSPATH variable in $OCAPROOT/java/OCAP-debug.properties
  2. Go to $OCAPROOT/java
  3. ant lib.test.3rdparty (rebuilds support-test.jar)
  4. Complied RI
  5. Run RI using command ./run_ri_wrapper.sh -coverage >> emmaFirstLog
  6. emmaFirstLog reads :

Using workroot == D:/ocap-Jan
Using workroot == D:/ocap-Jan
WORKROOT = D:/ocap-Jan
PLATFORMROOT = D:/ocap-Jan/ri/RI_Platform
OCAPROOT = D:/ocap-Jan/ri/RI_Stack
RICOMMONROOT = D:/ocap-Jan/common
OCAPHOST = Win32-Cygwin
OCAPTC = CableLabs/simulator/Win32/debug
JAVA_HOME = C:\Program Files\CATS\jdk1.6.0_20
ANT_HOME = D:\downloads\apache-ant-1.8.1
DOXYGEN_HOME =
VIDIOM_TOOLROOT = D:/ocap-Jan/ri/RI_Stack/bin/CableLabs/simulator/Win32/debug
CLIENTSIM_TOOLROOT = D:/ocap-Jan/ri/RI_Stack/bin/CableLabs/simulator/Win32/debug/bin
CLIENTSIM_ENV = D:/ocap-Jan/ri/RI_Stack/bin/CableLabs/simulator/Win32/debug/env
PATH = /usr/local/bin:/usr/bin:/bin:/cygdrive/c/Program Files/CATS/jdk1.6.0_20/bin:/cygdrive/c/Program Files/CATS/apache-maven-2.2.1/bin:/cygdrive/c/Program Files/CATS/eclipse-jee-galileo:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/ThinkPad Wireless LAN Adapter Software:/cygdrive/c/Program Files/Intel/WiFi/bin/:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/c/Program Files/Aladdin/eToken/PKIClient/x32:/cygdrive/c/Program Files/Code Collaborator Client:/cygdrive/c/Program Files/QuickTime/QTSystem/:/usr/lib/lapack:D:\downloads\apache-ant-1.8.1/bin:C:\Program Files\CATS\jdk1.6.0_20/bin:/bin:D:\downloads\apache-ant-1.8.1/bin:C:\Program Files\CATS\jdk1.6.0_20/bin:/bin
PLATFORMHOST = Win32-Cygwin
PLATFORMTC = Win32/debug
TWB_TOOLROOT = D:/ocap-Jan/ri/RI_Platform
finalProperties contains MACADDR
Instrumenting RI
EMMA: processing instrumentation path ...
EMMA: instrumentation path processed in 3375 ms
EMMA: [2382 class(es) instrumented, 886 resource(s) copied]
EMMA: metadata merged into [D:\ocap-Jan\ri\RI_Platform\coverage.em] {in 281 ms}
Now ran following command from a different cygwin shell :
$ java -cp $OCAPROOT/tools/generic/emma/emma.jar emma ctl -c coverage.get,,true,false
EMMA: processing control command sequence ...
EMMA: executing [coverage.get (coverage.ec,true,false)] ...
[EMMA v2.1, build 5320 (stable)]
emma ctl: coverage.get: RPC failure while executing [coverage.get]
Exception in thread "main" com.vladium.emma.EMMARuntimeException: coverage.get:
RPC failure while executing [coverage.get]
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:242)
at com.vladium.emma.Processor.run(Processor.java:88)
at com.vladium.emma.ctl.ctlCommand.run(ctlCommand.java:151)
at emma.main(emma.java:50)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
Please let me know if there is anything wrong with procedure followed, Thanks

spetrakos
Offline
Joined: 2010-12-10
Points: 0

Sorry for the late response.

You're steps look ok. Is the RI still running when you run "java -cp $OCAPROOT/tools/generic/emma/emma.jar emma ctl -c coverage.get,,true,false" in a separate cygwin window? It should be. If it is not it will cause the problem you describe.

santoshcv
Offline
Joined: 2010-12-21
Points: 0

Hi
Sorry for the late reply, I got it working - Classpath to the jar was missing in mepeenv.ini. The report looks good. Thanks.