I had the following Emma task in a build file to
extract coverage data from a JBoss instance and produce
a report:
<emma>
<ctl connect="localhost:47653" verbosity="verbose" >
<command name="coverage.get"
args="${coverage.dir}/coverage.emma" />
</ctl>
<report sourcepathref="emma.source" verbosity="verbose" >
<fileset dir="${coverage.dir}" >
<include name="*.emma" />
</fileset>
<html outfile="${coverage.dir}/index.html" />
</report>
</emma>
coverage.dir was set to a relative path (something like
"../../build/tests/webtest"). This didn't work, because
the <ctl /> task and the <report /> task for some
reason or other used different working directories. My
workaround was:
<!-- Convert coverage.dir into an absolute path, since
it seems to be interpreted using a different -->
<!-- working directory in the 'ctl' command than in the
'report' command. -->
<property name="co.dir" location="${coverage.dir}" />
<emma>
<ctl connect="localhost:47653" verbosity="verbose" >
<command name="coverage.get"
args="${co.dir}/coverage.emma" />
</ctl>
<report sourcepathref="emma.source" verbosity="verbose" >
<fileset dir="${co.dir}" >
<include name="*.emma" />
</fileset>
<html outfile="${co.dir}/index.html" />
</report>
</emma>
I think it would be best if both the <ctl/> and
<report/> tasks could somehow be made to use the same
working directory.