| <?xml version="1.0" ?> |
| |
| <!-- |
| |
| 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 |
| |
| 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. |
| |
| --> |
| |
| <project name="compiler.jx.tests" default="main" basedir="."> |
| |
| <pathconvert property="compiler.tests" dirsep="/"> |
| <path location="${basedir}"/> |
| </pathconvert> |
| |
| <property environment="env"/> |
| <property file="unittest.properties" /> |
| <property name="test.timeout" value="400000" /> |
| <property name="maxmem" value="512" /> |
| |
| <property name="compiler" value="${compiler.tests}/../.."/> |
| <property name="compiler-externc" value="${compiler}/../compiler-externc"/> |
| |
| <target name="download" description="Downloads third-party JARs"> |
| <ant antfile="${compiler.tests}/downloads.xml" dir="${compiler.tests}"/> |
| <delete dir="${compiler.tests}/in"/> |
| </target> |
| |
| <target name="js.swc"> |
| <copy file="${compiler-externc}/src/test/config/compile-as-config.xml" |
| todir="${compiler-externc}/target" /> |
| <java jar="${compiler}/lib/compc.jar" fork="true" |
| failonerror="true"> |
| <arg value="-targets=SWF"/> |
| <arg value="-load-config=${compiler-externc}/target/compile-as-config.xml" /> |
| <arg value="-output=${compiler-externc}/target/js.swc" /> |
| </java> |
| </target> |
| |
| <target name="custom.swc"> |
| <copy file="config/compile-js-config.xml" |
| todir="${compiler}/target" /> |
| <java jar="${compiler}/lib/compc.jar" fork="true" |
| failonerror="true"> |
| <arg value="-load-config=${compiler}/target/compile-js-config.xml" /> |
| <arg value="-output=${compiler}/target/custom.swc" /> |
| </java> |
| </target> |
| |
| <target name="compile.unit.tests"> |
| <delete dir="${compiler}/target/test-classes"/> |
| <mkdir dir="${compiler}/target/test-classes"/> |
| <copy todir="${compiler}/target/test-classes"> |
| <fileset dir="${compiler.tests}/resources"> |
| <include name="**"/> |
| </fileset> |
| </copy> |
| <javac debug="${javac.debug}" deprecation="${javac.deprecation}" |
| encoding="UTF-8" |
| destdir="${compiler}/target/test-classes" includeAntRuntime="true"> |
| <src path="${compiler.tests}/java"/> |
| <compilerarg value="-Xlint:all,-path"/> |
| <classpath> |
| <pathelement location="${compiler}/target/test-classes"/> |
| <pathelement location="${compiler}/../compiler-test-utils/target/classes"/> |
| <pathelement location="${compiler}/../compiler-externc/target/test-classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="unit.tests" depends="download, compile.unit.tests"> |
| <mkdir dir="${compiler}/target/junit-results"/> |
| <delete dir="${compiler}/target/junit-temp"/> |
| <mkdir dir="${compiler}/target/junit-temp"/> |
| <junit dir="${compiler}" |
| fork="yes" forkMode="perBatch" maxmemory="${maxmem}m" timeout="${test.timeout}" |
| printsummary="true" showoutput="true" |
| haltonerror="true" haltonfailure="true" |
| failureproperty="tests.unit.failed"> |
| <jvmarg value="-Dfile.encoding=UTF-8"/> |
| <classpath> |
| <pathelement location="${compiler}/target/test-classes"/> |
| <pathelement location="${compiler}/../compiler-test-utils/target/classes"/> |
| <pathelement location="${compiler}/../compiler-externc/target/test-classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler}/../compiler/lib" includes="**/*.jar"/> |
| </classpath> |
| <batchtest todir="${compiler}/target/junit-results"> |
| <fileset dir="${compiler}/target/test-classes"> |
| <include name="**/Test*.class"/> |
| <exclude name="**/TestRoyaleFile.class"/> |
| <exclude name="**/TestRoyaleMXML*.class"/> |
| <exclude name="**/TestSourceMapMXML*.class"/> |
| <exclude name="**/TestMXML*.class"/> |
| <exclude name="**/TestRoyaleClass.class"/> |
| <exclude name="**/TestTypedefsCompile.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| <assertions> |
| <enable/> |
| </assertions> |
| </junit> |
| </target> |
| |
| <target name="integration.tests.asjs" depends="download, compile.unit.tests"> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler}/target/junit-temp"/> |
| <junit dir="${compiler}" |
| fork="yes" forkMode="perBatch" maxmemory="${maxmem}m" timeout="${test.timeout}" |
| printsummary="true" showoutput="true" |
| haltonerror="true" haltonfailure="true" |
| failureproperty="tests.unit.failed"> |
| <jvmarg value="-Dfile.encoding=UTF-8"/> |
| <classpath> |
| <pathelement location="${compiler}/target/test-classes"/> |
| <pathelement location="${compiler}/../compiler-test-utils/target/classes"/> |
| <pathelement location="${compiler}/../compiler-externc/target/test-classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler}/../compiler/lib" includes="**/*.jar"/> |
| </classpath> |
| <batchtest todir="${compiler}/target/junit-results"> |
| <fileset dir="${compiler}/target/test-classes"> |
| <include name="**/TestRoyaleFile.class"/> |
| <include name="**/TestRoyaleMXML*.class"/> |
| <include name="**/TestSourceMapMXML*.class"/> |
| <exclude name="**/TestTypedefsCompile.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| <assertions> |
| <enable/> |
| </assertions> |
| </junit> |
| </target> |
| |
| <target name="integration.tests" depends="download, compile.unit.tests"> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler}/target/junit-temp"/> |
| <junit dir="${compiler}" |
| fork="yes" forkMode="perBatch" maxmemory="${maxmem}m" timeout="${test.timeout}" |
| printsummary="true" showoutput="true" |
| haltonerror="true" haltonfailure="true" |
| failureproperty="tests.unit.failed"> |
| <classpath> |
| <pathelement location="${compiler}/target/test-classes"/> |
| <pathelement location="${compiler}/../compiler-test-utils/target/classes"/> |
| <pathelement location="${compiler}/../compiler-externc/target/test-classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler}/../compiler/lib" includes="**/*.jar"/> |
| </classpath> |
| <batchtest todir="${compiler}/target/junit-results"> |
| <fileset dir="${compiler}/target/test-classes"> |
| <include name="**/TestMXML*.class"/> |
| <exclude name="**/TestTypedefsCompile.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| </junit> |
| <assertions> |
| <enable/> |
| </assertions> |
| </target> |
| |
| <target name="typedef.tests" depends="download, compile.unit.tests"> |
| <mkdir dir="${compiler}/target/junit-results"/> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler}/target/junit-temp"/> |
| <junit dir="${compiler}" |
| fork="yes" forkMode="perBatch" maxmemory="${maxmem}m" timeout="${test.timeout}" |
| printsummary="true" showoutput="true" |
| haltonerror="true" haltonfailure="true" |
| failureproperty="tests.unit.failed"> |
| <classpath> |
| <pathelement location="${compiler}/target/test-classes"/> |
| <pathelement location="${compiler}/../compiler-test-utils/target/classes"/> |
| <pathelement location="${compiler}/../compiler-externc/target/test-classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler}/../compiler/lib" includes="**/*.jar"/> |
| </classpath> |
| <batchtest todir="${compiler}/target/junit-results"> |
| <fileset dir="${compiler}/target/test-classes"> |
| <!-- requires royale-typedefs and compc --> |
| <include name="**/TestTypedefsCompile.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| <assertions> |
| <enable/> |
| </assertions> |
| </junit> |
| </target> |
| |
| <target name="main" depends="js.swc, custom.swc, unit.tests, integration.tests"/> |
| <target name="all" depends="main, typedef.tests, integration.tests.asjs"/> |
| |
| <target name="clean"> |
| <delete dir="${compiler.tests}/bin"/> |
| <delete dir="${compiler.tests}/classes"/> |
| <delete dir="${compiler.tests}/results"/> |
| </target> |
| |
| <target name="wipe" depends="clean"> |
| <delete dir="${compiler.tests}/lib"/> |
| <delete dir="${compiler}/target/junit-temp"/> |
| </target> |
| |
| </project> |