reinhard    2004/07/13 05:08:54

  Added:       src/test/anteater run-tests.xml
  Log:
  - moved from all-tests.xml and contains support for
    calling a single Anteater test
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/test/anteater/run-tests.xml
  
  Index: run-tests.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  
  <!--
  
    Automatically detects all the Anteater tests in the current
    directory and runs them.
  
    Author: Ovidiu Predescu "[EMAIL PROTECTED]"
    Date: April 4, 2002
  
    Description:
  
    To write a new Anteater test, just create a new Ant XML file with
    a default target. Then go in the top level directory of Cocoon and
    type:
  
    ./build.sh anteater-tests
    build anteater-tests
  
    The newly added test file will be picked up and executed
    auto-magically.
  
    For block-specific tests, create anteater scripts in a subdirectory
    called "test/anteater", for example src/blocks/batik/test/anteater
    for the batik block.
  
    -->
  
  <project name="anteater-tests" default="all">
  
    <taskdef resource="META-INF/Anteater.tasks"/>
    <typedef resource="META-INF/Anteater.types"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
  
    <property name="cocoon.base.dir" value="../../../.."/>
  
    <target name="init">
      <!-- use build.properties as in the main build file, for example to 
selectively disable tests -->
      <property file="${user.home}/cocoon.build.properties"/>
      <property file="${cocoon.base.dir}/local.build.properties"/>
      <property file="${cocoon.base.dir}/build.properties"/>
  
      <property name="anteater.env.cocoon" 
value="http://${host}:${port}/${base}"/>
      <property name="anteater.env.src-webapp-dir" 
value="../../../../src/webapp"/>
      <property name="anteater.env.deploy-dir" 
value="../../../../build/webapp"/>
    </target>
  
    <target name="all" depends="init">
      <foreach target="runtest" param="name">
        <fileset dir=".">
          <include name="*.xml"/>
          <exclude name="all-tests.xml"/>
        </fileset>
      </foreach>
    </target>
  
    <target name="single" depends="init">
      <foreach target="runtest" param="name">
        <fileset dir=".">
          <include name="${targetfile}.xml"/>
        </fileset>
      </foreach>
    </target>  
  
    <target name="runtest" depends="init">
      <basename property="target" file="${name}" suffix=".xml"/>
      <echo message="running test ${target} in dir ${basedir}"/>
      <ant antfile="${target}.xml" dir="${basedir}" inheritAll="yes"/>
    </target>
  </project>
  
  
  

Reply via email to