2005-07-02 16:17:40 -04:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!--
|
2006-11-29 02:06:35 -05:00
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You 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
|
2005-07-02 16:17:40 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Compiles and runs unit tests against distribution jar(s). Use .antrc or the
|
|
|
|
command line to control the jdk used to execute this build file.
|
|
|
|
|
|
|
|
Assumes that the distribution jar to be tested is in the base directory.
|
|
|
|
Use the "jardir" property to specify the path to the directory containing
|
|
|
|
the jar. Any other jars in this directory will also be added to the
|
|
|
|
classpath.
|
|
|
|
|
|
|
|
The default target, "test," executes clean as a dependency.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<project default="test" name="commons-math" basedir=".">
|
2011-02-21 11:53:30 -05:00
|
|
|
<!-- JDK level -->
|
|
|
|
<property name="compile.source" value="1.5"/>
|
|
|
|
<property name="compile.target" value="1.5"/>
|
|
|
|
|
2005-07-02 16:17:40 -04:00
|
|
|
<property name="defaulttargetdir" value="target"/>
|
|
|
|
<property name="testclassesdir" value="target/test-classes"/>
|
|
|
|
<property name="testreportdir" value="target/test-reports"/>
|
|
|
|
<property name="jardir" value="${basedir}"/>
|
2011-02-21 10:17:40 -05:00
|
|
|
<path id="build.classpath">
|
2011-02-21 09:31:52 -05:00
|
|
|
<fileset dir="${jardir}">
|
2011-02-21 18:35:55 -05:00
|
|
|
<include name="*.jar">
|
2005-07-02 16:17:40 -04:00
|
|
|
</include>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
2005-07-02 16:17:40 -04:00
|
|
|
<target name="clean" description="o Clean up the generated directories">
|
|
|
|
<delete dir="${defaulttargetdir}"/>
|
|
|
|
</target>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
2005-07-02 16:17:40 -04:00
|
|
|
<target name="init" description="o Initializes some properties">
|
|
|
|
<echo>
|
|
|
|
JAVA ENVIRONMENT
|
|
|
|
**************************Java runtime version*****************************
|
|
|
|
${java.runtime.version}
|
|
|
|
**************************Java class path**********************************
|
|
|
|
${java.class.path}
|
|
|
|
**************************Java home****************************************
|
|
|
|
${java.home}
|
|
|
|
*************************Java library path*******************************
|
|
|
|
Java library path: ${java.library.path}
|
|
|
|
===========================================================================
|
|
|
|
</echo>
|
|
|
|
<!--Test if JUNIT is present in ANT classpath-->
|
|
|
|
<available property="Junit.present" classname="junit.framework.Test">
|
|
|
|
</available>
|
|
|
|
</target>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
2005-07-02 16:17:40 -04:00
|
|
|
<target name="test" description="o Run the test cases" if="test.failure" depends="internal-test">
|
|
|
|
<fail message="There were test failures.">
|
|
|
|
</fail>
|
|
|
|
</target>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
|
|
|
<target name="internal-test" if="Junit.present" depends="clean,junit-present,compile-tests,test-only"/>
|
|
|
|
|
|
|
|
<target name="test-only">
|
2005-07-02 16:17:40 -04:00
|
|
|
<mkdir dir="${testreportdir}"/>
|
2011-02-21 10:27:39 -05:00
|
|
|
<junit dir="./" failureproperty="test.failure" printSummary="yes" fork="true" haltonerror="false">
|
2005-07-02 16:17:40 -04:00
|
|
|
<sysproperty key="basedir" value="."/>
|
2011-02-21 09:36:09 -05:00
|
|
|
<formatter usefile="true" type="brief"/>
|
2005-07-02 16:17:40 -04:00
|
|
|
<classpath>
|
|
|
|
<path refid="build.classpath"/>
|
|
|
|
<pathelement path="${testclassesdir}"/>
|
|
|
|
</classpath>
|
|
|
|
<batchtest todir="${testreportdir}">
|
2009-08-01 11:10:11 -04:00
|
|
|
<fileset dir="src/test/java">
|
2005-07-02 16:17:40 -04:00
|
|
|
<include name="**/*Test.java"/>
|
2011-02-21 10:22:23 -05:00
|
|
|
<include name="**/*TestBinary.java"/>
|
|
|
|
<include name="**/*TestPermutations.java"/>
|
2005-07-02 16:17:40 -04:00
|
|
|
<exclude name="**/*AbstractTest.java"/>
|
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
</target>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
2005-07-02 16:17:40 -04:00
|
|
|
<target name="junit-present" unless="Junit.present" depends="init">
|
|
|
|
<echo>
|
|
|
|
================================= WARNING ================================
|
|
|
|
Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed.
|
|
|
|
==========================================================================
|
|
|
|
</echo>
|
|
|
|
</target>
|
2011-02-21 10:17:40 -05:00
|
|
|
|
2008-04-24 10:40:29 -04:00
|
|
|
<target name="compile-tests" if="Junit.present" depends="junit-present">
|
2005-07-02 16:17:40 -04:00
|
|
|
<mkdir dir="${testclassesdir}"/>
|
2011-02-21 18:35:55 -05:00
|
|
|
<!-- includeantruntime="true" because JUnit may be provided by Ant -->
|
2011-02-21 11:53:30 -05:00
|
|
|
<javac destdir="${testclassesdir}"
|
|
|
|
deprecation="false"
|
|
|
|
debug="true"
|
2011-02-21 18:35:55 -05:00
|
|
|
includeantruntime="true"
|
2011-02-21 11:53:30 -05:00
|
|
|
source="${compile.source}"
|
|
|
|
target="${compile.target}"
|
|
|
|
optimize="false"
|
|
|
|
excludes="**/package.html">
|
2005-07-02 16:17:40 -04:00
|
|
|
<src>
|
|
|
|
<pathelement location="src/test"/>
|
|
|
|
</src>
|
|
|
|
<classpath>
|
|
|
|
<path refid="build.classpath"/>
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
|
|
|
<copy todir="${testclassesdir}">
|
2009-08-01 11:10:11 -04:00
|
|
|
<fileset dir="src/test/resources">
|
2005-07-02 16:17:40 -04:00
|
|
|
<include name="**/*.xml"/>
|
|
|
|
<include name="**/*.txt"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
2009-04-19 14:05:48 -04:00
|
|
|
</project>
|