ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Vedovini <CVedov...@odyssey-group.com>
Subject RE: Are Properties in sub-projects available to the master projec t?
Date Wed, 14 Aug 2002 11:41:26 GMT
I solved my problem using a special xsl file for the junitreport task...
May be it could be usefull to someone else...

following is my junit-noframes.xsl (this will create a "property file
looking" junit-noframes.html file):
<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" indent="no" media-type="text/plain"/>
  <xsl:template match="testsuites">
    <xsl:variable name="totalFailures" select="sum(testsuite/@errors) +
sum(testsuite/@failures)"/>
      <xsl:if test="$totalFailures &gt; 0">
        junit.failed=true
      </xsl:if>
  </xsl:template>
</xsl:stylesheet>

and here the way I use it:
<target name="junit.report" depends="junit.tests">
  <junitreport todir="${pub}/tests/xml">
    <fileset dir="." includes="**/TEST-*.xml"/>

    <!-- This one to create the real report -->
    <report format="frames" todir="${pub}/tests"/> 

    <!-- This one to create the property file -->
    <report format="noframes" styledir="${basedir}/etc"
todir="${pub}/tests"/> 
  </junitreport>

  <!-- Load the junit.failed property if it exists -->
  <property file="${pub}/tests/junit-noframes.html"/>
</target>

<target name="test" depends="junit.report" if="junit.failed">
  <fail message="Junit test cases did not perform 100%"/>
</target>


Cheers,
Claude

-----Original Message-----
From: Claude Vedovini [mailto:CVedovini@odyssey-group.com]
Sent: 14 August 2002 09:53
To: 'Ant Users List'
Subject: RE: Are Properties in sub-projects available to the master
projec t?


Well, as you say this kind of a hack... We would need some lines of ant code
to acheive this to be replicated in all our build files which are under the
responsibility of different teams.
May be, if no one has a better idea, it could be usefull to extend the
JUnitReport task to be somehow able to report also in properties?

Claude

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: 09 August 2002 20:48
To: 'Ant Users List'
Subject: RE: Are Properties in sub-projects available to the master
projec t?


Nope. Like unix processes, properties are not propagated back to the parent
build. You can achieve it using <propertyfile> though... Write a file by the
sub-build, that you read back in the parent, but it's kind of a hack. --DD

-----Original Message-----
From: Claude Vedovini [mailto:CVedovini@odyssey-group.com] 
Sent: Friday, August 09, 2002 12:19 PM
To: Ant Users (E-mail)
Subject: Are Properties in sub-projects available to the master project?

Hi all,

I have a master build file that call other ant build files that run junit
tasks with the failureProperty="test.failed" attribute set, however when
tests are failing the master should fail calling the <fail/> task but this
does not append and I suspect the test.failed property is only available in
sub-builds, am I wrong?

Thx
Claude
__________________________________________________________________________
* This email and any files transmitted with it are CONFIDENTIAL and intended
   solely for the use of the individual or entity to which they are
addressed.
* Any unauthorized copying, disclosure, or distribution of the material
within
   this email is strictly forbidden.
* Any views or opinions presented within this e-mail are solely those of the
   author and do not necessarily represent those of Odyssey Asset Management
   Systems SA unless otherwise specifically stated.
* An electronic message is not binding on its sender.  Any message referring
to
   a binding engagement must be confirmed in writing and duly signed.
* If you have received this email in error, please notify the sender
immediately
   and delete the original.

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
__________________________________________________________________________
* This email and any files transmitted with it are CONFIDENTIAL and intended
   solely for the use of the individual or entity to which they are
addressed.
* Any unauthorized copying, disclosure, or distribution of the material
within
   this email is strictly forbidden.
* Any views or opinions presented within this e-mail are solely those of the
   author and do not necessarily represent those of Odyssey Asset Management
   Systems SA unless otherwise specifically stated.
* An electronic message is not binding on its sender.  Any message referring
to
   a binding engagement must be confirmed in writing and duly signed.
* If you have received this email in error, please notify the sender
immediately
   and delete the original.
__________________________________________________________________________
* This email and any files transmitted with it are CONFIDENTIAL and intended
   solely for the use of the individual or entity to which they are
addressed.
* Any unauthorized copying, disclosure, or distribution of the material
within
   this email is strictly forbidden.
* Any views or opinions presented within this e-mail are solely those of the
   author and do not necessarily represent those of Odyssey Asset Management
   Systems SA unless otherwise specifically stated.
* An electronic message is not binding on its sender.  Any message referring
to
   a binding engagement must be confirmed in writing and duly signed.
* If you have received this email in error, please notify the sender
immediately
   and delete the original.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message