| <?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}/../.."/> |
| |
| <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="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="copyLastSuccessfulBuild" depends="check_asjs, get_asjs" /> |
| <target name="check_asjs" > |
| <available file="${env.ASJS_HOME}/frameworks/libs/Network.swc" |
| type="file" |
| property="asjs.ok" |
| value="true" /> |
| </target> |
| <target name="get_asjs" unless="asjs.ok" > |
| <get src="http://apacheflexbuild.cloudapp.net:8080/job/royale-asjs/lastSuccessfulBuild/artifact/out/apache-royale-flexjs-0.9.0-bin.zip" dest="${compiler}/target/junit-temp/royale.zip"/> |
| <unzip src="${compiler}/target/junit-temp/royale.zip" dest="${env.ASJS_HOME}"> |
| <patternset> |
| <include name="frameworks/libs/*.swc"/> |
| </patternset> |
| </unzip> |
| <delete file="${compiler}/target/junit-temp/royale.zip" /> |
| </target> |
| |
| <target name="main" depends="unit.tests, integration.tests"/> |
| <target name="all" depends="unit.tests, integration.tests, 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> |