You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2005/07/01 06:38:34 UTC

cvs commit: logging-log4j/tests .cvsignore build.properties.sample build.xml

carnold     2005/06/30 21:38:34

  Modified:    tests    Tag: v1_2-branch .cvsignore build.properties.sample
                        build.xml
  Log:
  Bug 35572: Add test coverage analysis to v1_2branch
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.3.2.2   +2 -0      logging-log4j/tests/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/.cvsignore,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- .cvsignore	27 Jun 2005 19:40:18 -0000	1.3.2.1
  +++ .cvsignore	1 Jul 2005 04:38:34 -0000	1.3.2.2
  @@ -1,3 +1,5 @@
   output
   classes
   build.properties
  +coverage
  +log4j.db*
  
  
  
  1.3.2.2   +7 -9      logging-log4j/tests/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/build.properties.sample,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- build.properties.sample	3 Jun 2005 05:29:54 -0000	1.3.2.1
  +++ build.properties.sample	1 Jul 2005 04:38:34 -0000	1.3.2.2
  @@ -1,13 +1,11 @@
  -jakarta.oro.jar=../../jakarta-oro-2.0.5/jakarta-oro-2.0.5.jar
  -xml-api.jar=../../xerces-2_6_2/xml-apis.jar
  -xml-impl.jar=../../erces-2_6_2/xercesImpl.jar
  +#
  +#   by default assume that all necessary dependencies
  +#      are relative to the user's home directory
  +#
  +lib.home.dir=${user.home}
  +jakarta.oro.jar=${lib.home.dir}/jakarta-oro-2.0.8/jakarta-oro-2.0.8.jar
  +clover.jar="${lib.home.dir}/clover-1.3.8/lib/clover.jar
   deprecation=on
   
   # junit must be on the classpath! It can't be handled as a property.
   
  -# The current test files require:
  -#   Ant 1.6.4 running in
  -#   Sun JDK 1.3
  -#   with jUnit 3.8.1
  -# This is because of the format of the exceptions recorded in the test
  -# witness files is particular to these versions.
  
  
  
  1.16.2.8  +52 -2     logging-log4j/tests/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/build.xml,v
  retrieving revision 1.16.2.7
  retrieving revision 1.16.2.8
  diff -u -r1.16.2.7 -r1.16.2.8
  --- build.xml	30 Jun 2005 23:16:58 -0000	1.16.2.7
  +++ build.xml	1 Jul 2005 04:38:34 -0000	1.16.2.8
  @@ -33,6 +33,7 @@
       <pathelement location="${jakarta.oro.jar}"/>
       <pathelement location="${xml-api.jar}"/>
       <pathelement location="${xml-impl.jar}"/>
  +    <pathelement location="${clover.jar}"/>
     </path>
   
     <!-- ================================================================= -->
  @@ -64,11 +65,28 @@
       <mkdir dir="./output" />
     </target>
   
  +  <!-- Clean the parent project                                          -->
  +  <!-- ================================================================= -->
  +  <target name="parentClean">
  +    <ant dir=".." target="clean" inheritRefs="true"/>
  +  </target>
  +  
  +  
  +  
  +  <!-- ================================================================= -->
  +  <!-- Build the parent project                                          -->
  +  <!-- ================================================================= -->  
  +  <target name="parentBuild">    
  +    <ant dir=".." target="build.core" inheritRefs="true"/>
  +    <ant dir=".." target="build.xml" inheritRefs="true"/>
  +  </target>
  +
   
     <!-- ================================================================= -->
     <!-- Compile test cases and related source files.                      -->
     <!-- ================================================================= -->
  -  <target name="build" depends="prepare">
  +  <target name="build" depends="parentBuild, prepare">
  +    <property name="haltonfailure" value="yes"/>
       <javac srcdir="${tests.source.home}"
   	         destdir="./classes"
              deprecation="${deprecation}"
  @@ -231,7 +249,7 @@
         </java>
         <sequential>
   	<sleep seconds="2"/>
  -	<junit printsummary="yes" fork="yes" haltonfailure="yes">
  +	<junit printsummary="yes" fork="yes" haltonfailure="${haltonfailure}">
   	  <sysproperty key="testNumber" value="1"/>
   	  <classpath refid="tests.classpath"/>
   	  <formatter type="plain" usefile="false" />
  @@ -328,5 +346,37 @@
     
     <!-- none yet, but StressCategory is a good candidate... -->
     
  +   <!-- ============================================================= --> 
  +   <!--                      Coverage analysis                        -->
  +   <!-- ============================================================= --> 
  +   <target name="with.clover">
  +        <!-- some tests fail when running clover
  +                setting this property will cause testing to continue  -->
  +        <property name="haltonfailure" value="no"/>
  +        <available resource="clovertasks" property="clover-present"/>
  +
  +        <fail unless="clover-present">
  +          clover.jar must be in the classpath and should also be
  +          placed in the lib directory.  A version of clover 
  +          (http://www.cenqua.com/clover) for use with ASF projects 
  +          is available from the committers/donated-licenses/clover module 
  +          in the SVN repository. 
  +       </fail>
  +         
  +       <taskdef resource="clovertasks"/>
  +       <clover-setup initString="log4j.db"/>
  +    </target>
  +
  +    <target name="coverageReport" depends="parentClean, clean, with.clover, runAll">
  +      <mkdir dir="coverage"/>
  +      <taskdef resource="clovertasks"/>
  +      <clover-report>
  +        <current title="log4j coverage" outfile="coverage">
  +          <format type="html"/>
  +        </current>
  +      </clover-report>
  +    </target>
  +
  +  
   </project>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org