Emma code coverage, missing source files from report

I have a problem in that the EMMA generated HTML reports do not have the source files linked into the reports. When I drill down to the individual classes I have the following text where the highlighted source should be :



I'm making sure I build my source w/ the -g (debug="true" in ant) property, exclude any rmic generated classes etc. And in fact I have two projects on this build server which do in fact link the source files in the reports correctly.

Furthermore, to test a theory I had, I let the build run, made sure the reports generated in the coverage directory did not link to the source. Then I copied the line which showed the EMMA command for generating report which looks like this :

: EMMA commandline:

I ran this command and added the -sp to specify the source dir :

java emma -r html txt -sp C:\RSSP\Dev\Cerberus\console\src -sp C:\RSSP\Dev\Cerberus\console/../../issJavaCommon/src -in C:\RSSP\Dev\Cerberus\console\coverage.em -in C:\RSSP\Dev\Cerberus\console\coverage.ec -Dreport.html.out.file=coverage/index.html

This generated the reports and linked to the source correctly.

So my question is this, what am I doing wrong in my project? Is there any way to pass the -sp parameters to teamcity to let emma know where to look for the source files? And furthermore, what baffles me is the fact that the other two projects, which have very similar directory structure for the sourcepath and outputpaths, do provide the source in the reports.

Any thoughts? I can upload some build logs if it helps, or provide more info on my build env structure if that helps. But I'm hoping there is simply a way to force the -sp parameter on emma during report generation, which seems to be the fix.

3 comments

Hello,

TeamCity tries to discover source paths automatically, and currently there
is no way to override this behaviour. I think you are right and we should
provide a way to specify additional source paths. Could you please submit an
issue and provide a snippet of your build script where you compile your
source code?

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Rafal Niedzialkowski" <rniedzial@us.ibm.com> wrote in message
news:4982102.1204832374851.JavaMail.itn@is.intellij.net...
>I have a problem in that the EMMA generated HTML reports do not have the
>source files linked into the reports. When I drill down to the individual
>classes I have the following text where the highlighted source should be :
>

>

I'm making sure I build my source w/ the -g (debug="true" in ant)
property, exclude any rmic generated classes etc. And in fact I have two
projects on this build server which do in fact link the source files in
the reports correctly.

>

Furthermore, to test a theory I had, I let the build run, made sure the
reports generated in the coverage directory did not link to the source.
Then I copied the line which showed the EMMA command for generating report
which looks like this :

>

: EMMA commandline: [-r, html,txt, -in,
C:\RSSP\Dev\Cerberus\console\coverage.em,C:\RSSP\Dev\Cerberus\console\coverage.ec,
-Dreport.html.out.file=coverage/index.html]

>

I ran this command and added the -sp to specify the source dir :

>

java emma -r html txt -sp C:\RSSP\Dev\Cerberus\console\src -sp
C:\RSSP\Dev\Cerberus\console/../../issJavaCommon/src -in
C:\RSSP\Dev\Cerberus\console\coverage.em -in
C:\RSSP\Dev\Cerberus\console\coverage.ec -Dreport.html.out.file=coverage/index.html

>

This generated the reports and linked to the source correctly.

>

So my question is this, what am I doing wrong in my project? Is there any
way to pass the -sp parameters to teamcity to let emma know where to look
for the source files? And furthermore, what baffles me is the fact that
the other two projects, which have very similar directory structure for
the sourcepath and outputpaths, do provide the source in the reports.

>

Any thoughts? I can upload some build logs if it helps, or provide more
info on my build env structure if that helps. But I'm hoping there is
simply a way to force the -sp parameter on emma during report generation,
which seems to be the fix.



0

After talking to Kirill Maximov via email regarding a previous issue I was having, he told me that TeamCity determines the sourcepath based on your ANT ]]> "srcdir" attribute. After looking at my build file he noticed that my javac target was using "srcDIR" instead of "srcdir" -- apparently the case matters. After fixing this, presto, EMMA started linking to the source correctly!

Might it be possible to have TeamCity ignoreCase on ANT targets, to prevent this sort of user issue? :)

At any rate, thanks Kirill for spotting the problem and quick reply!

0

Hi,
I am facing similar issue.
But i dont have source code in my project. we have only jar files deployed to the server. I am instrumented the jar files and was able to generate the report. but i am not able to view the which lines are covered and which lines are not due to source code not available in the project. all our jar files execute at run time in the application.

Is there way to solve this issue.

0

Please sign in to leave a comment.