You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/04/29 02:36:06 UTC
cvs commit: cocoon-2.1/tools/targets test-build.xml
joerg 2004/04/28 17:36:06
Modified: tools/targets test-build.xml
Log:
output test results into files, create a nice junit report (= HTML) out of it;
no longer "haltonfailure" for the tests (we would not get the report), if we need a failing build we can use "failureproperty"
Revision Changes Path
1.7 +14 -3 cocoon-2.1/tools/targets/test-build.xml
Index: test-build.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/targets/test-build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- test-build.xml 8 Mar 2004 06:07:15 -0000 1.6
+++ test-build.xml 29 Apr 2004 00:36:06 -0000 1.7
@@ -25,10 +25,15 @@
<!-- Runs JUnit tests -->
<target name="junit-tests" depends="compile-tests">
- <junit printsummary="yes" haltonfailure="yes" fork="yes">
+ <delete dir="${build.test.output}"/>
+ <mkdir dir="${build.test.output}"/>
+ <junit printsummary="yes" fork="yes">
+ <!--jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/-->
<classpath refid="test.classpath"/>
- <formatter type="plain" usefile="no" />
- <batchtest>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${build.test.output}">
<fileset dir="${build.test}">
<include name="**/*TestCase.class"/>
<include name="**/*Test.class" />
@@ -39,6 +44,12 @@
</fileset>
</batchtest>
</junit>
+ <junitreport todir="${build.test.output}">
+ <fileset dir="${build.test.output}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${build.test.output}"/>
+ </junitreport>
</target>
<!-- Anteater tests -->
Re: cvs commit: cocoon-2.1/tools/targets test-build.xml
Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.04.2004 10:57, Ugo Cei wrote:
>> Modified: tools/targets test-build.xml
>> Log:
>> output test results into files, create a nice junit report (= HTML)
>> out of it;
>> no longer "haltonfailure" for the tests (we would not get the
>> report), if we need a failing build we can use "failureproperty"
>
>
> The HTML report certainly looks nice and I'm 100% for it.
>
> But not halting on failure looks like a risk, IMHO. We already have
> commits done without running the tests and I'm afraid that the few
> people that do run tests will suppose they succeeded just because they
> see "BUILD SUCCESSFUL" at the end, and missing a single "FAILED" in the
> output is all too easy.
>
> Couldn't we have two targets for this? "Build test" will work just as
> before and "build testreport" will create the HTML report and not halt.
>
> WDYT?
Exactly therefore I wrote "if we need a failing build we can use
'failureproperty'". The junit task [1] has an attribute failureproperty,
which stores the name of property that is set if one of the tests failed:
<junit failureproperty="tests.failed">
...
</junit>
After generating the report we can simply do:
<fail if="test.failed" message="Tests failed, have a look at the HTML
report at ${build.test.output} for the details."/> [2]
or something like that.
Joerg
[1] http://ant.apache.org/manual/OptionalTasks/junit.html
[2] http://ant.apache.org/manual/CoreTasks/fail.html
Re: cvs commit: cocoon-2.1/tools/targets test-build.xml
Posted by Ugo Cei <ug...@apache.org>.
Il giorno 29/apr/04, alle 02:36, joerg@apache.org ha scritto:
> joerg 2004/04/28 17:36:06
>
> Modified: tools/targets test-build.xml
> Log:
> output test results into files, create a nice junit report (= HTML)
> out of it;
> no longer "haltonfailure" for the tests (we would not get the
> report), if we need a failing build we can use "failureproperty"
The HTML report certainly looks nice and I'm 100% for it.
But not halting on failure looks like a risk, IMHO. We already have
commits done without running the tests and I'm afraid that the few
people that do run tests will suppose they succeeded just because they
see "BUILD SUCCESSFUL" at the end, and missing a single "FAILED" in the
output is all too easy.
Couldn't we have two targets for this? "Build test" will work just as
before and "build testreport" will create the HTML report and not halt.
WDYT?
Ugo