From: Mark D. <Mar...@sa...> - 2005-06-15 18:22:45
|
It sounds like you need to pass a sysproperty to the Junit task that = specifies the location of the cobertura.ser file. Something like <junit ...> <sysproperty key=3D"net.sourceforge.cobertura.datafile" value=3D"${cobertura.file}"/> </junit> Also, the merge tasks has problems in Cobertura 1.3. It should be a = better in CVS, but could still use some more testing. -Mark =20 > -----Original Message----- > From: cob...@li...=20 > [mailto:cob...@li...] On=20 > Behalf Of bastard metheus > Sent: Wednesday, June 15, 2005 2:14 PM > To: Cob...@li... > Subject: [Cobertura-devel] duplicate copies of cobertura.ser file?? >=20 > I've been working with getting cobertura reports to generate=20 > properly and so=20 > far i've noticed that even if i specify the same datafile=20 > location for both=20 > cobertura-instrument and cobertura-report tags, an=20 > additionally coberura.ser=20 > file is stored 2 directories up from my basedir. This=20 > additional file causes=20 > the reports to display 0% (line & branch) coverage. I've=20 > haven't had any=20 > luck with the cobertura-merge tag, it doesn't seem to be=20 > working properly.=20 > Anyway I've decided to point to the ser file that is 2=20 > directories up when=20 > reporting and just move it to a specified locaiton when done=20 > generating the=20 > reports. This is a very ugly hack. I was wondering if anyone=20 > could help me=20 > find a quick and clean way to handle this such that only one=20 > file is ever=20 > generated in the proper location. >=20 > Thanks in advance, > -B >=20 > The following is the build target: >=20 > <target name=3D"junit" description=3D"Run All JUnit Tests" > depends=3D"remove-reports"> >=20 > <!-- > <property name=3D"corbertura.file" value=3D"cobertura.ser" /> > --> > <echo level=3D"info">Deleting Corbertura SER=20 > file=3D"${corbertura.file}</echo> > <delete file=3D"${corbertura.file}"/> > <echo level=3D"info">Deleting Instruments=20 > dir=3D"${dir.instruments}"</echo> > <delete dir=3D"${dir.instruments}" /> >=20 > <echo level=3D"info">Making Instruments=20 > Dir=3D"${dir.instruments}"</echo> > <mkdir dir=3D"${dir.instruments}"/> >=20 > <echo level=3D"info">Creating Instruments:=09 > datafile=3D"${corbertura.file}"=20 > todir=3D"${dir.instruments}" > </echo> >=20 > <cobertura-instrument datafile=3D"../../${corbertura.file}"=20 > todir=3D"${dir.instruments}"> > <fileset dir=3D"${dir.classes}"> > <!-- > Instrument all the application=20 > classes, but > don't instrument the test classes. > --> > <include name=3D"**/*.class" /> > <exclude name=3D"**/*Test.class" /> > </fileset> > </cobertura-instrument> >=20 > <echo level=3D"info">Running JUnit ${dir.test.classes}</echo> > <junit printsummary=3D"yes" haltonerror=3D"${haltonerror}"=20 > fork=3D"yes" > showoutput=3D"${showoutput}"> > <classpath location=3D"${dir.instruments}"/> > <classpath location=3D"${dir.classes}"/> > <classpath refid=3D"build_classpath"/> > <jvmarg value=3D"-Xmx${memoryValue}m"/> >=20 > <batchtest todir=3D"${dir.reports}" > haltonerror=3D"${haltonerror}" fork=3D"yes"> > <formatter type=3D"xml"/> > <fileset dir=3D"${dir.classes}"> > <include name=3D"**/*Test*.class"/> > <exclude name=3D"**/*$*.class"/> > </fileset> > </batchtest> > </junit> >=20 > <echo level=3D"info">Making=20 > dir=3D"${dir.reports.artifacts}/cobertura"</echo> > <mkdir dir=3D"${dir.reports.artifacts}/cobertura"/> > <cobertura-report format=3D"html"=20 > datafile=3D"../../${corbertura.file}" > srcdir=3D"${dir.src}" > destdir=3D"${dir.reports.artifacts}/cobertura"/> >=20 > <move file=3D"../../cobertura.ser"=20 > todir=3D"bin/test/reports/artifacts/cobertura"/> >=20 > <antcall target=3D"archive"/> > </target> |
From: Mark D. <Mar...@sa...> - 2005-06-20 15:12:36
|
Currently a log4j "info" message is printed, but that's all. Printing a = warning or an error isn't quite correct, because technically it should = be ok to create a new cobertura.ser file when running your tests. = Technically users should be able to create cobertura.ser's all over the = place and then merge them into one big file at the end when they want to = generate their reports. For this same reason, hard coding the location to cobertura.ser as part = of the instrumentation may not be a good idea. What if people want to = copy their instrumented code to other machines? Or even other = architectures? The location would likely be different when running on a = different system. -Mark > -----Original Message----- > From: cob...@li...=20 > [mailto:cob...@li...] On=20 > Behalf Of Grzegorz Lukasik > Sent: Wednesday, June 15, 2005 4:19 PM > To: Cob...@li... > Subject: Re: [Cobertura-devel] duplicate copies of=20 > cobertura.ser file?? >=20 > Or maybe it would be useful if this solution was implemented: >=20 > During instrumentation the location of created cobertura.ser file is > somehow stored inside instrumented classes - for example some > additional method CoverageData.setDataFileLocation is called inside > static constructor of instrumeted classes. Or maybe some file is > created among instrumented classes. This way there is no need for > specifiyng the location of this file during runtime. >=20 > I thought about this solution some time ago, but I am not sure it is > right. Any thoughts? >=20 > Grzegorz >=20 >=20 >=20 > On 6/15/05, Mark Doliner <Mar...@sa...> wrote: > > It sounds like you need to pass a sysproperty to the Junit=20 > task that specifies the location of the cobertura.ser file. =20 > Something like > > <junit ...> > > <sysproperty key=3D"net.sourceforge.cobertura.datafile" > > value=3D"${cobertura.file}"/> > > </junit> > >=20 > > Also, the merge tasks has problems in Cobertura 1.3. It=20 > should be a better in CVS, but could still use some more testing. > > -Mark > >=20 > >=20 > > > -----Original Message----- > > > From: cob...@li... > > > [mailto:cob...@li...] On > > > Behalf Of bastard metheus > > > Sent: Wednesday, June 15, 2005 2:14 PM > > > To: Cob...@li... > > > Subject: [Cobertura-devel] duplicate copies of=20 > cobertura.ser file?? > > > > > > I've been working with getting cobertura reports to generate > > > properly and so > > > far i've noticed that even if i specify the same datafile > > > location for both > > > cobertura-instrument and cobertura-report tags, an > > > additionally coberura.ser > > > file is stored 2 directories up from my basedir. This > > > additional file causes > > > the reports to display 0% (line & branch) coverage. I've > > > haven't had any > > > luck with the cobertura-merge tag, it doesn't seem to be > > > working properly. > > > Anyway I've decided to point to the ser file that is 2 > > > directories up when > > > reporting and just move it to a specified locaiton when done > > > generating the > > > reports. This is a very ugly hack. I was wondering if anyone > > > could help me > > > find a quick and clean way to handle this such that only one > > > file is ever > > > generated in the proper location. > > > > > > Thanks in advance, > > > -B > > > > > > The following is the build target: > > > > > > <target name=3D"junit" description=3D"Run All JUnit Tests" > > > depends=3D"remove-reports"> > > > > > > <!-- > > > <property name=3D"corbertura.file" value=3D"cobertura.ser" = /> > > > --> > > > <echo level=3D"info">Deleting Corbertura SER > > > file=3D"${corbertura.file}</echo> > > > <delete file=3D"${corbertura.file}"/> > > > <echo level=3D"info">Deleting Instruments > > > dir=3D"${dir.instruments}"</echo> > > > <delete dir=3D"${dir.instruments}" /> > > > > > > <echo level=3D"info">Making Instruments > > > Dir=3D"${dir.instruments}"</echo> > > > <mkdir dir=3D"${dir.instruments}"/> > > > > > > <echo level=3D"info">Creating Instruments: > > > datafile=3D"${corbertura.file}" > > > todir=3D"${dir.instruments}" > > > </echo> > > > > > > <cobertura-instrument datafile=3D"../../${corbertura.file}" > > > todir=3D"${dir.instruments}"> > > > <fileset dir=3D"${dir.classes}"> > > > <!-- > > > Instrument all the application > > > classes, but > > > don't instrument the test classes. > > > --> > > > <include name=3D"**/*.class" /> > > > <exclude name=3D"**/*Test.class" /> > > > </fileset> > > > </cobertura-instrument> > > > > > > <echo level=3D"info">Running JUnit = ${dir.test.classes}</echo> > > > <junit printsummary=3D"yes" haltonerror=3D"${haltonerror}" > > > fork=3D"yes" > > > showoutput=3D"${showoutput}"> > > > <classpath location=3D"${dir.instruments}"/> > > > <classpath location=3D"${dir.classes}"/> > > > <classpath refid=3D"build_classpath"/> > > > <jvmarg value=3D"-Xmx${memoryValue}m"/> > > > > > > <batchtest todir=3D"${dir.reports}" > > > haltonerror=3D"${haltonerror}" fork=3D"yes"> > > > <formatter type=3D"xml"/> > > > <fileset dir=3D"${dir.classes}"> > > > <include name=3D"**/*Test*.class"/> > > > <exclude name=3D"**/*$*.class"/> > > > </fileset> > > > </batchtest> > > > </junit> > > > > > > <echo level=3D"info">Making > > > dir=3D"${dir.reports.artifacts}/cobertura"</echo> > > > <mkdir dir=3D"${dir.reports.artifacts}/cobertura"/> > > > <cobertura-report format=3D"html" > > > datafile=3D"../../${corbertura.file}" > > > srcdir=3D"${dir.src}" > > > destdir=3D"${dir.reports.artifacts}/cobertura"/> > > > > > > <move file=3D"../../cobertura.ser" > > > todir=3D"bin/test/reports/artifacts/cobertura"/> > > > > > > <antcall target=3D"archive"/> > > > </target> > >=20 > >=20 > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration=20 > Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > > _______________________________________________ > > Cobertura-devel mailing list > > Cob...@li... > > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel >=20 |
From: Grzegorz L. <ha...@gm...> - 2005-06-20 20:17:43
|
Hi I admit that I do not like this solution too much. I think it should not be implemented. But to defend it a little, I was thinking of this behaviour: 1) Check if net.something system property is set, and if so - use it 2) If there is no such system property then use hardcoded path It could be useful for first time users, that was the idea.=20 Grzegorz On 6/20/05, Mark Doliner <Mar...@sa...> wrote: > Currently a log4j "info" message is printed, but that's all. Printing a = warning or an error isn't quite correct, because technically it should be o= k to create a new cobertura.ser file when running your tests. Technically = users should be able to create cobertura.ser's all over the place and then = merge them into one big file at the end when they want to generate their re= ports. >=20 > For this same reason, hard coding the location to cobertura.ser as part o= f the instrumentation may not be a good idea. What if people want to copy = their instrumented code to other machines? Or even other architectures? T= he location would likely be different when running on a different system. >=20 > -Mark >=20 > > -----Original Message----- > > From: cob...@li... > > [mailto:cob...@li...] On > > Behalf Of Grzegorz Lukasik > > Sent: Wednesday, June 15, 2005 4:19 PM > > To: Cob...@li... > > Subject: Re: [Cobertura-devel] duplicate copies of > > cobertura.ser file?? > > > > Or maybe it would be useful if this solution was implemented: > > > > During instrumentation the location of created cobertura.ser file is > > somehow stored inside instrumented classes - for example some > > additional method CoverageData.setDataFileLocation is called inside > > static constructor of instrumeted classes. Or maybe some file is > > created among instrumented classes. This way there is no need for > > specifiyng the location of this file during runtime. > > > > I thought about this solution some time ago, but I am not sure it is > > right. Any thoughts? > > > > Grzegorz > > > > > > > > On 6/15/05, Mark Doliner <Mar...@sa...> wrote: > > > It sounds like you need to pass a sysproperty to the Junit > > task that specifies the location of the cobertura.ser file. > > Something like > > > <junit ...> > > > <sysproperty key=3D"net.sourceforge.cobertura.datafile" > > > value=3D"${cobertura.file}"/> > > > </junit> > > > > > > Also, the merge tasks has problems in Cobertura 1.3. It > > should be a better in CVS, but could still use some more testing. > > > -Mark > > > > > > > > > > -----Original Message----- > > > > From: cob...@li... > > > > [mailto:cob...@li...] On > > > > Behalf Of bastard metheus > > > > Sent: Wednesday, June 15, 2005 2:14 PM > > > > To: Cob...@li... > > > > Subject: [Cobertura-devel] duplicate copies of > > cobertura.ser file?? > > > > > > > > I've been working with getting cobertura reports to generate > > > > properly and so > > > > far i've noticed that even if i specify the same datafile > > > > location for both > > > > cobertura-instrument and cobertura-report tags, an > > > > additionally coberura.ser > > > > file is stored 2 directories up from my basedir. This > > > > additional file causes > > > > the reports to display 0% (line & branch) coverage. I've > > > > haven't had any > > > > luck with the cobertura-merge tag, it doesn't seem to be > > > > working properly. > > > > Anyway I've decided to point to the ser file that is 2 > > > > directories up when > > > > reporting and just move it to a specified locaiton when done > > > > generating the > > > > reports. This is a very ugly hack. I was wondering if anyone > > > > could help me > > > > find a quick and clean way to handle this such that only one > > > > file is ever > > > > generated in the proper location. > > > > > > > > Thanks in advance, > > > > -B > > > > > > > > The following is the build target: > > > > > > > > <target name=3D"junit" description=3D"Run All JUnit Tests" > > > > depends=3D"remove-reports"> > > > > > > > > <!-- > > > > <property name=3D"corbertura.file" value=3D"cobertura.ser" /> > > > > --> > > > > <echo level=3D"info">Deleting Corbertura SER > > > > file=3D"${corbertura.file}</echo> > > > > <delete file=3D"${corbertura.file}"/> > > > > <echo level=3D"info">Deleting Instruments > > > > dir=3D"${dir.instruments}"</echo> > > > > <delete dir=3D"${dir.instruments}" /> > > > > > > > > <echo level=3D"info">Making Instruments > > > > Dir=3D"${dir.instruments}"</echo> > > > > <mkdir dir=3D"${dir.instruments}"/> > > > > > > > > <echo level=3D"info">Creating Instruments: > > > > datafile=3D"${corbertura.file}" > > > > todir=3D"${dir.instruments}" > > > > </echo> > > > > > > > > <cobertura-instrument datafile=3D"../../${corbertura.file}" > > > > todir=3D"${dir.instruments}"> > > > > <fileset dir=3D"${dir.classes}"> > > > > <!-- > > > > Instrument all the application > > > > classes, but > > > > don't instrument the test classes. > > > > --> > > > > <include name=3D"**/*.class" /> > > > > <exclude name=3D"**/*Test.class" /> > > > > </fileset> > > > > </cobertura-instrument> > > > > > > > > <echo level=3D"info">Running JUnit ${dir.test.classes}</echo= > > > > > <junit printsummary=3D"yes" haltonerror=3D"${haltonerror}" > > > > fork=3D"yes" > > > > showoutput=3D"${showoutput}"> > > > > <classpath location=3D"${dir.instruments}"/> > > > > <classpath location=3D"${dir.classes}"/> > > > > <classpath refid=3D"build_classpath"/> > > > > <jvmarg value=3D"-Xmx${memoryValue}m"/> > > > > > > > > <batchtest todir=3D"${dir.reports}" > > > > haltonerror=3D"${haltonerror}" fork=3D"yes"> > > > > <formatter type=3D"xml"/> > > > > <fileset dir=3D"${dir.classes}"> > > > > <include name=3D"**/*Test*.class"/> > > > > <exclude name=3D"**/*$*.class"/> > > > > </fileset> > > > > </batchtest> > > > > </junit> > > > > > > > > <echo level=3D"info">Making > > > > dir=3D"${dir.reports.artifacts}/cobertura"</echo> > > > > <mkdir dir=3D"${dir.reports.artifacts}/cobertura"/> > > > > <cobertura-report format=3D"html" > > > > datafile=3D"../../${corbertura.file}" > > > > srcdir=3D"${dir.src}" > > > > destdir=3D"${dir.reports.artifacts}/cobertura"/> > > > > > > > > <move file=3D"../../cobertura.ser" > > > > todir=3D"bin/test/reports/artifacts/cobertura"/> > > > > > > > > <antcall target=3D"archive"/> > > > > </target> > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is sponsored by: Discover Easy Linux Migration > > Strategies > > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > > informative Webcasts and more! Get everything you need to get up to > > > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > > > _______________________________________________ > > > Cobertura-devel mailing list > > > Cob...@li... > > > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > > _______________________________________________ > > Cobertura-devel mailing list > > Cob...@li... > > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > > |
From: Grzegorz L. <ha...@gm...> - 2005-06-15 20:06:04
|
Added cobertura-devel mailing list. ---------- Forwarded message ---------- From: Grzegorz Lukasik <ha...@gm...> Date: Jun 15, 2005 9:58 PM Subject: Re: [Cobertura-devel] duplicate copies of cobertura.ser file?? To: Mark Doliner <Mar...@sa...> Maybe some warning should be issued. Something like: Evironment property net.sourceforge.cobertura.datafile not found, data file will be stored as ${absoulte path to the file}. Grzegorz On 6/15/05, Mark Doliner <Mar...@sa...> wrote: > It sounds like you need to pass a sysproperty to the Junit task that spec= ifies the location of the cobertura.ser file. Something like > <junit ...> > <sysproperty key=3D"net.sourceforge.cobertura.datafile" > value=3D"${cobertura.file}"/> > </junit> > > Also, the merge tasks has problems in Cobertura 1.3. It should be a bett= er in CVS, but could still use some more testing. > -Mark > > > > -----Original Message----- > > From: cob...@li... > > [mailto:cob...@li...] On > > Behalf Of bastard metheus > > Sent: Wednesday, June 15, 2005 2:14 PM > > To: Cob...@li... > > Subject: [Cobertura-devel] duplicate copies of cobertura.ser file?? > > > > I've been working with getting cobertura reports to generate > > properly and so > > far i've noticed that even if i specify the same datafile > > location for both > > cobertura-instrument and cobertura-report tags, an > > additionally coberura.ser > > file is stored 2 directories up from my basedir. This > > additional file causes > > the reports to display 0% (line & branch) coverage. I've > > haven't had any > > luck with the cobertura-merge tag, it doesn't seem to be > > working properly. > > Anyway I've decided to point to the ser file that is 2 > > directories up when > > reporting and just move it to a specified locaiton when done > > generating the > > reports. This is a very ugly hack. I was wondering if anyone > > could help me > > find a quick and clean way to handle this such that only one > > file is ever > > generated in the proper location. > > > > Thanks in advance, > > -B > > > > The following is the build target: > > > > <target name=3D"junit" description=3D"Run All JUnit Tests" > > depends=3D"remove-reports"> > > > > <!-- > > <property name=3D"corbertura.file" value=3D"cobertura.ser" /> > > --> > > <echo level=3D"info">Deleting Corbertura SER > > file=3D"${corbertura.file}</echo> > > <delete file=3D"${corbertura.file}"/> > > <echo level=3D"info">Deleting Instruments > > dir=3D"${dir.instruments}"</echo> > > <delete dir=3D"${dir.instruments}" /> > > > > <echo level=3D"info">Making Instruments > > Dir=3D"${dir.instruments}"</echo> > > <mkdir dir=3D"${dir.instruments}"/> > > > > <echo level=3D"info">Creating Instruments: > > datafile=3D"${corbertura.file}" > > todir=3D"${dir.instruments}" > > </echo> > > > > <cobertura-instrument datafile=3D"../../${corbertura.file}" > > todir=3D"${dir.instruments}"> > > <fileset dir=3D"${dir.classes}"> > > <!-- > > Instrument all the application > > classes, but > > don't instrument the test classes. > > --> > > <include name=3D"**/*.class" /> > > <exclude name=3D"**/*Test.class" /> > > </fileset> > > </cobertura-instrument> > > > > <echo level=3D"info">Running JUnit ${dir.test.classes}</echo> > > <junit printsummary=3D"yes" haltonerror=3D"${haltonerror}" > > fork=3D"yes" > > showoutput=3D"${showoutput}"> > > <classpath location=3D"${dir.instruments}"/> > > <classpath location=3D"${dir.classes}"/> > > <classpath refid=3D"build_classpath"/> > > <jvmarg value=3D"-Xmx${memoryValue}m"/> > > > > <batchtest todir=3D"${dir.reports}" > > haltonerror=3D"${haltonerror}" fork=3D"yes"> > > <formatter type=3D"xml"/> > > <fileset dir=3D"${dir.classes}"> > > <include name=3D"**/*Test*.class"/> > > <exclude name=3D"**/*$*.class"/> > > </fileset> > > </batchtest> > > </junit> > > > > <echo level=3D"info">Making > > dir=3D"${dir.reports.artifacts}/cobertura"</echo> > > <mkdir dir=3D"${dir.reports.artifacts}/cobertura"/> > > <cobertura-report format=3D"html" > > datafile=3D"../../${corbertura.file}" > > srcdir=3D"${dir.src}" > > destdir=3D"${dir.reports.artifacts}/cobertura"/> > > > > <move file=3D"../../cobertura.ser" > > todir=3D"bin/test/reports/artifacts/cobertura"/> > > > > <antcall target=3D"archive"/> > > </target> > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |
From: Grzegorz L. <ha...@gm...> - 2005-06-15 20:18:41
|
Or maybe it would be useful if this solution was implemented: During instrumentation the location of created cobertura.ser file is somehow stored inside instrumented classes - for example some additional method CoverageData.setDataFileLocation is called inside static constructor of instrumeted classes. Or maybe some file is created among instrumented classes. This way there is no need for specifiyng the location of this file during runtime. I thought about this solution some time ago, but I am not sure it is right. Any thoughts? Grzegorz On 6/15/05, Mark Doliner <Mar...@sa...> wrote: > It sounds like you need to pass a sysproperty to the Junit task that spec= ifies the location of the cobertura.ser file. Something like > <junit ...> > <sysproperty key=3D"net.sourceforge.cobertura.datafile" > value=3D"${cobertura.file}"/> > </junit> >=20 > Also, the merge tasks has problems in Cobertura 1.3. It should be a bett= er in CVS, but could still use some more testing. > -Mark >=20 >=20 > > -----Original Message----- > > From: cob...@li... > > [mailto:cob...@li...] On > > Behalf Of bastard metheus > > Sent: Wednesday, June 15, 2005 2:14 PM > > To: Cob...@li... > > Subject: [Cobertura-devel] duplicate copies of cobertura.ser file?? > > > > I've been working with getting cobertura reports to generate > > properly and so > > far i've noticed that even if i specify the same datafile > > location for both > > cobertura-instrument and cobertura-report tags, an > > additionally coberura.ser > > file is stored 2 directories up from my basedir. This > > additional file causes > > the reports to display 0% (line & branch) coverage. I've > > haven't had any > > luck with the cobertura-merge tag, it doesn't seem to be > > working properly. > > Anyway I've decided to point to the ser file that is 2 > > directories up when > > reporting and just move it to a specified locaiton when done > > generating the > > reports. This is a very ugly hack. I was wondering if anyone > > could help me > > find a quick and clean way to handle this such that only one > > file is ever > > generated in the proper location. > > > > Thanks in advance, > > -B > > > > The following is the build target: > > > > <target name=3D"junit" description=3D"Run All JUnit Tests" > > depends=3D"remove-reports"> > > > > <!-- > > <property name=3D"corbertura.file" value=3D"cobertura.ser" /> > > --> > > <echo level=3D"info">Deleting Corbertura SER > > file=3D"${corbertura.file}</echo> > > <delete file=3D"${corbertura.file}"/> > > <echo level=3D"info">Deleting Instruments > > dir=3D"${dir.instruments}"</echo> > > <delete dir=3D"${dir.instruments}" /> > > > > <echo level=3D"info">Making Instruments > > Dir=3D"${dir.instruments}"</echo> > > <mkdir dir=3D"${dir.instruments}"/> > > > > <echo level=3D"info">Creating Instruments: > > datafile=3D"${corbertura.file}" > > todir=3D"${dir.instruments}" > > </echo> > > > > <cobertura-instrument datafile=3D"../../${corbertura.file}" > > todir=3D"${dir.instruments}"> > > <fileset dir=3D"${dir.classes}"> > > <!-- > > Instrument all the application > > classes, but > > don't instrument the test classes. > > --> > > <include name=3D"**/*.class" /> > > <exclude name=3D"**/*Test.class" /> > > </fileset> > > </cobertura-instrument> > > > > <echo level=3D"info">Running JUnit ${dir.test.classes}</echo> > > <junit printsummary=3D"yes" haltonerror=3D"${haltonerror}" > > fork=3D"yes" > > showoutput=3D"${showoutput}"> > > <classpath location=3D"${dir.instruments}"/> > > <classpath location=3D"${dir.classes}"/> > > <classpath refid=3D"build_classpath"/> > > <jvmarg value=3D"-Xmx${memoryValue}m"/> > > > > <batchtest todir=3D"${dir.reports}" > > haltonerror=3D"${haltonerror}" fork=3D"yes"> > > <formatter type=3D"xml"/> > > <fileset dir=3D"${dir.classes}"> > > <include name=3D"**/*Test*.class"/> > > <exclude name=3D"**/*$*.class"/> > > </fileset> > > </batchtest> > > </junit> > > > > <echo level=3D"info">Making > > dir=3D"${dir.reports.artifacts}/cobertura"</echo> > > <mkdir dir=3D"${dir.reports.artifacts}/cobertura"/> > > <cobertura-report format=3D"html" > > datafile=3D"../../${corbertura.file}" > > srcdir=3D"${dir.src}" > > destdir=3D"${dir.reports.artifacts}/cobertura"/> > > > > <move file=3D"../../cobertura.ser" > > todir=3D"bin/test/reports/artifacts/cobertura"/> > > > > <antcall target=3D"archive"/> > > </target> >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |