| <?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.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="3000000" /> |
| <property name="maxmem" value="512" /> |
| |
| <condition property="sdk" value="${FLEX_HOME}" else="${env.FLEX_HOME}"> |
| <isset property="FLEX_HOME" /> |
| </condition> |
| |
| <condition property="fpdbg" value="${FLASHPLAYER_DEBUGGER}" else="${env.FLASHPLAYER_DEBUGGER}"> |
| <isset property="FLASHPLAYER_DEBUGGER" /> |
| </condition> |
| |
| <condition property="playerglobal.version" value="${env.PLAYERGLOBAL_VERSION}"> |
| <isset property="env.PLAYERGLOBAL_VERSION" /> |
| </condition> |
| <property name="playerglobal.version" value="11.1" /> |
| |
| <property name="compiler" value="${compiler.tests}/../compiler"/> |
| <property name="falcon" value="${compiler}/generated/dist/sdk"/> |
| |
| <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="eclipse"> |
| <copy file="${fpdbg}" tofile="${compiler.tests}/temp/FlashPlayer.exe"/> |
| </target> |
| |
| <target name="jar.tests"> |
| <java jar="${falcon}/lib/falcon-mxmlc.jar" fork="true"/> |
| <java jar="${falcon}/lib/falcon-compc.jar" fork="true"/> |
| <java jar="${falcon}/lib/falcon-asc.jar" fork="true"/> |
| <java jar="${falcon}/lib/falcon-optimizer.jar" fork="true"/> |
| <java jar="${falcon}/lib/falcon-swfdump.jar" fork="true"/> |
| </target> |
| |
| <target name="ant.tests"> |
| <property name="FLEX_HOME" value="${sdk}"/> |
| <property name="FALCON_HOME" value="${falcon}"/> |
| <taskdef resource="flexTasks.tasks" classpath="${falcon}/lib/falcon-flexTasks.jar"/> |
| <mxmlc file="${compiler.tests}/Hello.as" target-player="${playerglobal.version}"/> |
| <delete file="${compiler.tests}/Hello.swf"/> |
| <compc output="Hello.swc" include-classes="Hello" target-player="${playerglobal.version}"> |
| <source-path path-element="${compiler.tests}"/> |
| </compc> |
| <delete file="${compiler.tests}/Hello.swc"/> |
| </target> |
| |
| <target name="compile.unit.tests"> |
| <delete dir="${compiler.tests}/classes"/> |
| <mkdir dir="${compiler.tests}/classes"/> |
| <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler.tests}/classes" includeAntRuntime="true"> |
| <src path="${compiler.tests}/unit-tests"/> |
| <src path="${compiler.tests}/src"/> |
| <compilerarg value="-Xlint:all,-path"/> |
| <classpath> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="unit.tests" depends="download, compile.unit.tests"> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler.tests}/temp"/> |
| <junit dir="${compiler.tests}" |
| 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.tests}/classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| <batchtest todir="${compiler.tests}/results"> |
| <fileset dir="${compiler.tests}/classes"> |
| <include name="**/*Tests.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| </junit> |
| </target> |
| |
| <target name="compile.feature.tests"> |
| <delete dir="${compiler.tests}/classes"/> |
| <mkdir dir="${compiler.tests}/classes"/> |
| <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler.tests}/classes" includeAntRuntime="true"> |
| <src path="${compiler.tests}/feature-tests"/> |
| <src path="${compiler.tests}/src"/> |
| <compilerarg value="-Xlint:all,-path"/> |
| <classpath> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="feature.tests" depends="download, compile.feature.tests"> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler.tests}/temp"/> |
| <junit dir="${compiler.tests}" |
| 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.tests}/classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| <batchtest todir="${compiler.tests}/results"> |
| <fileset dir="${compiler.tests}/classes"> |
| <include name="**/*Tests.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| </junit> |
| </target> |
| |
| <target name="compile.functional.tests"> |
| <delete dir="${compiler.tests}/classes" /> |
| <mkdir dir="${compiler.tests}/classes"/> |
| <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler.tests}/classes" includeAntRuntime="true"> |
| <src path="${compiler.tests}/src"/> |
| <src path="${compiler.tests}/functional-tests"/> |
| <compilerarg value="-Xlint:all,-path"/> |
| <classpath> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="functional.tests" depends="download, compile.functional.tests"> |
| <mkdir dir="${compiler.tests}/results"/> |
| <mkdir dir="${compiler.tests}/temp"/> |
| <junit dir="${compiler.tests}" |
| fork="yes" forkMode="perBatch" maxmemory="${maxmem}m" timeout="${test.timeout}" |
| printsummary="true" showoutput="true" |
| haltonerror="true" haltonfailure="true" |
| failureproperty="tests.functional.failed"> |
| <classpath> |
| <pathelement location="${compiler.tests}/classes"/> |
| <fileset dir="${compiler}/lib" includes="**/*.jar"/> |
| <fileset dir="${compiler.tests}/lib" includes="**/*.jar"/> |
| <pathelement location="${falcon}/lib/compiler.jar"/> |
| </classpath> |
| <batchtest todir="${compiler.tests}/results"> |
| <fileset dir="${compiler.tests}/classes"> |
| <include name="**/*Tests.class"/> |
| </fileset> |
| </batchtest> |
| <formatter type="xml"/> |
| </junit> |
| </target> |
| |
| <target name="main" depends="unit.tests, feature.tests, functional.tests, jar.tests, ant.tests"/> |
| |
| <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.tests}/temp"/> |
| </target> |
| |
| </project> |