aboutsummaryrefslogtreecommitdiffstats
path: root/make/build-test.xml
diff options
context:
space:
mode:
Diffstat (limited to 'make/build-test.xml')
-rw-r--r--make/build-test.xml145
1 files changed, 145 insertions, 0 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
new file mode 100644
index 0000000..e543a1c
--- /dev/null
+++ b/make/build-test.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+
+<!--
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+-->
+
+<project name="JOALTest" basedir="." default="all">
+
+ <property name="junit.path" value="${basedir}/${gluegen.root}/make/lib/junit.jar"/>
+ <property name="ant-contrib.jar" value="${gluegen.root}/make/lib/ant-contrib-1.0b3.jar" />
+
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+ </taskdef>
+
+ <target name="test.init">
+ <mkdir dir="classes"/>
+ <property name="rootrel.src.test" value="src/test" />
+ <property name="src.test" value="${project.root}/${rootrel.src.test}" />
+
+ <property name="results.test" value="${build}/test/results" />
+ <property name="build.test" value="${build}/test/build" />
+ <property name="obj.test" value="${build.test}/obj"/>
+
+ <property name="classes" value="${build.test}/classes" />
+ <property name="classes.path" location="${classes}"/> <!-- absolute path -->
+
+ <property name="java.dir.test" value="com/jogamp/openal/test"/>
+ <property name="java.part.test" value="${java.dir.test}/**"/>
+ <property name="java.dir.junit" value="${java.dir.test}/junit"/>
+ <property name="java.dir.manual" value="${java.dir.test}/manual"/>
+
+ <property name="obj.all.paths" value="${gluegen.root}/build/obj${path.separator}${obj}"/>
+ <property name="classpath.all" value="${gluegen.root}/build/gluegen-rt.jar${path.separator}${build}/joal.jar${path.separator}${classes}${path.separator}${junit.path}"/>
+
+ <property name="batchtest.timeout" value="1800000"/> <!-- 30 min -->
+ </target>
+
+ <target name="test.compile" depends="test.init">
+ <javac debug="true" srcdir="${src.test}" destdir="${classes}" includeantruntime="false"
+ classpath="${gluegen.root}/build/gluegen-rt.jar;../build/joal.jar;${junit.path}"/>
+ <copy todir="${classes}">
+ <fileset dir="${src.test}" includes="**/*.wav"/>
+ </copy>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.test}"/>
+ </target>
+
+ <target name="test.auto.run" depends="junit.run"/>
+
+ <target name="junit.run" depends="test.compile">
+ <mkdir dir="${results.test}"/>
+ <junit forkmode="once" showoutput="true" fork="true" includeAntRuntime="true">
+ <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+ <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+ <jvmarg value="-Djogamp.debug.NativeLibrary=true"/>
+ <jvmarg value="-Djogamp.debug.NativeLibrary.Lookup=true"/>
+ <jvmarg value="-Djogamp.debug.ProcAddressHelper=true"/>
+ <batchtest todir="${results.test}">
+ <fileset dir="${classes}">
+ <include name="${java.dir.junit}/**/*Test*"/>
+ </fileset>
+ <formatter usefile="false" type="plain"/>
+ <formatter usefile="true" type="xml"/>
+ </batchtest>
+ <classpath>
+ <path path="${classpath.all}"/>
+ </classpath>
+ </junit>
+ </target>
+
+ <target name="test.manual.run" depends="test.compile">
+ <for param="test.class.path.m" keepgoing="true">
+ <!-- results in absolute path -->
+ <fileset dir="${classes}">
+ <include name="${java.dir.manual}/**/*Test*"/>
+ <exclude name="**/*$$*"/>
+ </fileset>
+ <sequential>
+ <var name="test.class.path" unset="true"/>
+ <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
+ <var name="test.class.fqn" unset="true"/>
+ <pathconvert property="test.class.fqn">
+ <fileset file="${classes}${file.separator}${test.class.path}"/>
+ <chainedmapper>
+ <globmapper from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
+ <packagemapper from="*.class" to="*"/> <!-- FQCN -->
+ </chainedmapper>
+ </pathconvert>
+ <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.log"/>
+ <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
+ <apply dir="." executable="${java.home}/bin/java"
+ parallel="false"
+ timeout="${batchtest.timeout}"
+ vmlauncher="false"
+ relative="true"
+ failonerror="false">
+ <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+ <env key="CLASSPATH" value="${classpath.all}"/>
+ <arg value="-Djava.library.path=${obj.all.paths}"/>
+ <arg line="-Djogamp.debug.NativeLibrary=true"/>
+ <arg line="-Djogamp.debug.NativeLibrary.Lookup=true"/>
+ <arg line="-Djogamp.debug.ProcAddressHelper=true"/>
+ <srcfile/>
+ <mappedresources>
+ <fileset dir="${classes}" includes="${test.class.path}"/>
+ <packagemapper from="*.class" to="*"/>
+ </mappedresources>
+ </apply>
+ </sequential>
+ </for>
+ </target>
+
+</project>