You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2019/05/21 17:41:25 UTC

[royale-asjs] branch develop updated: frameworks: library unit tests use Ant task instead of Ant task

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new e884f20  frameworks: library unit tests use <royaleunit> Ant task instead of <flexunit> Ant task
e884f20 is described below

commit e884f206067057a71882ec2f643952c6d8100ba0
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue May 21 10:41:17 2019 -0700

    frameworks: library unit tests use <royaleunit> Ant task instead of <flexunit> Ant task
---
 frameworks/build.xml                               | 14 +++++++--
 .../projects/Basic/src/test/royale/build.xml       | 34 +++++-----------------
 frameworks/projects/Core/src/test/royale/build.xml | 34 +++++-----------------
 .../projects/RoyaleUnit/src/test/royale/build.xml  | 34 +++++-----------------
 4 files changed, 32 insertions(+), 84 deletions(-)

diff --git a/frameworks/build.xml b/frameworks/build.xml
index d0bcfa3..14ecd3a 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -60,7 +60,7 @@
     <property file="${ROYALE_HOME}/build.properties"/>
     <property name="ROYALE_HOME" value="${ROYALE_HOME}" />
 
-    <target name="main" depends="check-compile-env,clean,prepare,compile,fonts"
+    <target name="main" depends="check-compile-env,clean,prepare,compile,test,fonts"
         description="Clean build of all SWCs"/>
 
     <target name="check-compile-env" description="Check for the required environment variables">
@@ -118,8 +118,6 @@
         <antcall target="Collections"/>
         <antcall target="Basic"/>
         <antcall target="Ace"/>
-        <antcall target="RoyaleUnitTest"/>
-        <antcall target="CoreTest"/>
         <antcall target="HTML"/>
         <antcall target="Effects"/>
         <antcall target="Flat"/>
@@ -147,6 +145,12 @@
 		<antcall target="Icons"/>
     </target>
 
+    <target name="test" description="Tests all SWCs">
+        <antcall target="RoyaleUnitTest"/>
+        <antcall target="CoreTest"/>
+        <antcall target="BasicTest"/>
+    </target>
+
     <target name="fonts">
         <ant dir="${basedir}/fontsrc" target="main"/>
     </target>
@@ -291,6 +295,10 @@
         <ant dir="${basedir}/projects/Basic"/>
     </target>
 
+    <target name="BasicTest" description="Test of Basic.swc">
+        <ant dir="${basedir}/projects/Basic" target="test"/>
+    </target>
+
     <target name="HTML" description="Clean build of HTML.swc">
         <ant dir="${basedir}/projects/HTML"/>
     </target>
diff --git a/frameworks/projects/Basic/src/test/royale/build.xml b/frameworks/projects/Basic/src/test/royale/build.xml
index d452d24..3f6cef7 100644
--- a/frameworks/projects/Basic/src/test/royale/build.xml
+++ b/frameworks/projects/Basic/src/test/royale/build.xml
@@ -37,22 +37,6 @@
     </condition>
 
     <property name="report.dir" value="${basedir}/out" />
-    
-    <available file="${ROYALE_HOME}/in/flexunit"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${ROYALE_HOME}/in/flexunit" />
-    
-    <available file="${env.FLEXUNIT_HOME}"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${env.FLEXUNIT_HOME}"/>
-
-    <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target"
-        type="dir"
-        property="FLEXUNIT_CLASSPATH"
-        value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
-    <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
 
     <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
     </target>
@@ -72,13 +56,13 @@
     
     <path id="lib.path">
       <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
+      <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="royaleUnitTasks.jar"/>
     </path>
 
-    <target name="compile" description="Compiles FlexUnitApplication.swf">
+    <target name="compile" description="Compiles FlexUnitRoyaleApplication.swf">
         <echo message="Compiling FlexUnitRoyaleApplication.swf"/>
         <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
         <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
-        <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/>
         <echo message="playerglobal.version: ${playerglobal.version}"/>
 
         <!-- Load the <compc> task. We can't do this at the <project> level -->
@@ -108,15 +92,11 @@
     </target>
 
     <target name="test">
-        <taskdef resource="flexUnitTasks.tasks">
-            <classpath>
-                <fileset dir="${FLEXUNIT_CLASSPATH}">
-                    <include name="flexUnitTasks*.jar" />
-                </fileset>
-            </classpath>
-        </taskdef>
+        <!-- Load the <royaleunit> task. We can't do this at the <project> level -->
+        <!-- because targets that run before royaleUnitTasks.jar gets built would fail. -->
+        <taskdef resource="royaleUnitTasks.tasks" classpathref="lib.path"/>
 		<mkdir dir="${report.dir}" />
-		<flexunit
+		<royaleunit
             swf="${basedir}/FlexUnitRoyaleApplication.swf"
 		    workingDir="${basedir}"
 		    toDir="${report.dir}"
@@ -126,7 +106,7 @@
 			timeout="90000">
             <source dir="${ROYALE_HOME}/frameworks/projects/Basic/src/main/royale" />
             <library dir="${ROYALE_HOME}/frameworks/libs" />
-        </flexunit>
+        </royaleunit>
         
 		<!-- Generate readable JUnit-style reports -->
 		<junitreport todir="${report.dir}">
diff --git a/frameworks/projects/Core/src/test/royale/build.xml b/frameworks/projects/Core/src/test/royale/build.xml
index a90a105..d98403b 100644
--- a/frameworks/projects/Core/src/test/royale/build.xml
+++ b/frameworks/projects/Core/src/test/royale/build.xml
@@ -37,22 +37,6 @@
     </condition>
 
     <property name="report.dir" value="${basedir}/out" />
-    
-    <available file="${ROYALE_HOME}/in/flexunit"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${ROYALE_HOME}/in/flexunit" />
-    
-    <available file="${env.FLEXUNIT_HOME}"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${env.FLEXUNIT_HOME}"/>
-
-    <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target"
-        type="dir"
-        property="FLEXUNIT_CLASSPATH"
-        value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
-    <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
 
     <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
     </target>
@@ -72,13 +56,13 @@
     
     <path id="lib.path">
       <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
+      <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="royaleUnitTasks.jar"/>
     </path>
 
-    <target name="compile" description="Compiles FlexUnitApplication.swf">
+    <target name="compile" description="Compiles FlexUnitRoyaleApplication.swf">
         <echo message="Compiling FlexUnitRoyaleApplication.swf"/>
         <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
         <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
-        <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/>
         <echo message="playerglobal.version: ${playerglobal.version}"/>
 
         <!-- Load the <compc> task. We can't do this at the <project> level -->
@@ -113,15 +97,11 @@
     </target>
 
     <target name="test">
-        <taskdef resource="flexUnitTasks.tasks">
-            <classpath>
-                <fileset dir="${FLEXUNIT_CLASSPATH}">
-                    <include name="flexUnitTasks*.jar" />
-                </fileset>
-            </classpath>
-        </taskdef>
+        <!-- Load the <royaleunit> task. We can't do this at the <project> level -->
+        <!-- because targets that run before royaleUnitTasks.jar gets built would fail. -->
+        <taskdef resource="royaleUnitTasks.tasks" classpathref="lib.path"/>
 		<mkdir dir="${report.dir}" />
-		<flexunit
+		<royaleunit
             swf="${basedir}/FlexUnitRoyaleApplication.swf"
 		    workingDir="${basedir}"
 		    toDir="${report.dir}"
@@ -131,7 +111,7 @@
 			timeout="90000">
             <source dir="${ROYALE_HOME}/frameworks/projects/Core/src/main/royale" />
             <library dir="${ROYALE_HOME}/frameworks/libs" />
-        </flexunit>
+        </royaleunit>
         
 		<!-- Generate readable JUnit-style reports -->
 		<junitreport todir="${report.dir}">
diff --git a/frameworks/projects/RoyaleUnit/src/test/royale/build.xml b/frameworks/projects/RoyaleUnit/src/test/royale/build.xml
index 29cfc63..2001d6b 100644
--- a/frameworks/projects/RoyaleUnit/src/test/royale/build.xml
+++ b/frameworks/projects/RoyaleUnit/src/test/royale/build.xml
@@ -37,22 +37,6 @@
     </condition>
 
     <property name="report.dir" value="${basedir}/out" />
-    
-    <available file="${ROYALE_HOME}/in/flexunit"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${ROYALE_HOME}/in/flexunit" />
-    
-    <available file="${env.FLEXUNIT_HOME}"
-        type="dir"
-        property="FLEXUNIT_HOME"
-        value="${env.FLEXUNIT_HOME}"/>
-
-    <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target"
-        type="dir"
-        property="FLEXUNIT_CLASSPATH"
-        value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
-    <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
 
     <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
     </target>
@@ -72,13 +56,13 @@
     
     <path id="lib.path">
       <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
+      <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="royaleUnitTasks.jar"/>
     </path>
 
-    <target name="compile" description="Compiles FlexUnitApplication.swf">
+    <target name="compile" description="Compiles FlexUnitRoyaleApplication.swf">
         <echo message="Compiling FlexUnitRoyaleApplication.swf"/>
         <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
         <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
-        <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/>
         <echo message="playerglobal.version: ${playerglobal.version}"/>
 
         <!-- Load the <compc> task. We can't do this at the <project> level -->
@@ -113,15 +97,11 @@
     </target>
 
     <target name="test">
-        <taskdef resource="flexUnitTasks.tasks">
-            <classpath>
-                <fileset dir="${FLEXUNIT_CLASSPATH}">
-                    <include name="flexUnitTasks*.jar" />
-                </fileset>
-            </classpath>
-        </taskdef>
+        <!-- Load the <royaleunit> task. We can't do this at the <project> level -->
+        <!-- because targets that run before royaleUnitTasks.jar gets built would fail. -->
+        <taskdef resource="royaleUnitTasks.tasks" classpathref="lib.path"/>
 		<mkdir dir="${report.dir}" />
-		<flexunit
+		<royaleunit
             swf="${basedir}/FlexUnitRoyaleApplication.swf"
 		    workingDir="${basedir}"
 		    toDir="${report.dir}"
@@ -131,7 +111,7 @@
 			timeout="90000">
             <source dir="${ROYALE_HOME}/frameworks/projects/RoyaleUnit/src/main/royale" />
             <library dir="${ROYALE_HOME}/frameworks/libs" />
-        </flexunit>
+        </royaleunit>
         
 		<!-- Generate readable JUnit-style reports -->
 		<junitreport todir="${report.dir}">