head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2001.08.03.22.54.32;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.08.03.22.46.12;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Added cleanup both of file and after tests.
@
text
@<project name="helm-tests" default="run-tests" basedir=".">

  <!-- Build classpath -->
  <path id="classpath">
    <pathelement location="${build.test}"/>
    <fileset dir="${lib.dir}">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${site.lib.dir}">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${java.lib.dir}">
      <include name="**/*.jar"/>
    </fileset>
  </path>

  <target name="prepare" description="--> prepares testcases">
    <available property="junit.present"
      classname="junit.framework.TestCase">
      <classpath refid="classpath"/>
    </available>

    <mkdir dir="${build.test}/org"/>

    <javac srcdir="${src.test.dir}/org"
      destdir="${build.test}"
      excludes="**/package.html"
      debug="${debug}"
      deprecation="${deprecation}"
      optimize="${optimize}">

      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="clean">
    <delete dir="${build.test}"/>
  </target>

  <!-- ================================================================== -->
  <!-- Run testcases                                                      -->
  <!-- ================================================================== -->
  <target name="run-tests" depends="prepare" if="junit.present"
            description="--> runs all available testcases">
        
    <junit printsummary="no" haltonfailure="yes">
      <classpath>
        <pathelement location="${build.test}"/>
        <path refid="classpath"/>
        <pathelement path="${classpath}"/>
      </classpath>

      <formatter type="plain" usefile="false"/>

      <batchtest>
        <fileset dir="${src.test.dir}">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
    </junit>

    <antcall target="clean"/>
  </target>

  <!-- ================================================================== -->
  <!-- Run an single testcase                                             -->
  <!-- ================================================================== -->  
  <target name="run-singletest" if="testcase">
    <junit printsummary="no" haltonfailure="yes">
      <classpath>
        <pathelement location="${build.test}"/>
        <path refid="classpath" />
        <pathelement path="${classpath}"/>
      </classpath>

      <formatter type="plain" usefile="false"/>

      <test name="${testcase}"/>
    </junit>

    <antcall target="clean"/>
  </target>

</project>
@


1.1
log
@Unit test build file.
@
text
@d1 1
a1 1
<project name="turbine-tests" default="run-tests" basedir=".">
a17 1

d34 1
d36 2
a37 1
    <echo message="build.test=${build.test}"/>
d60 1
d62 1
a62 4
      <!--
      <test name="org.tigris.helm.tool.cluster.ClusteredSingletonServiceTest"/>
      -->
    </junit>
d67 1
a67 2
  <!-- ================================================================== -->
  
a68 1
  
d80 2
@

