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/22 21:32:37 UTC

[royale-asjs] branch develop updated: BasicJS, CoreJS, RoyaleUnitJS: enabled RoyaleUnit tests

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 b54e30c  BasicJS, CoreJS, RoyaleUnitJS: enabled RoyaleUnit tests
b54e30c is described below

commit b54e30c1a068bf4cf74e53691f24c64263a833ca
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed May 22 14:32:04 2019 -0700

    BasicJS, CoreJS, RoyaleUnitJS: enabled RoyaleUnit tests
---
 .../js/projects/BasicJS/src/test/royale/build.xml  | 139 +++++++++++++++++++++
 .../js/projects/CoreJS/src/test/royale/build.xml   | 139 +++++++++++++++++++++
 .../RoyaleUnitJS/src/test/royale/build.xml         | 139 +++++++++++++++++++++
 3 files changed, 417 insertions(+)

diff --git a/frameworks/js/projects/BasicJS/src/test/royale/build.xml b/frameworks/js/projects/BasicJS/src/test/royale/build.xml
new file mode 100644
index 0000000..b65f991
--- /dev/null
+++ b/frameworks/js/projects/BasicJS/src/test/royale/build.xml
@@ -0,0 +1,139 @@
+<?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="BasicJS.test" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../../../../../.."/>
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${env.ROYALE_HOME}"/>
+    <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/>
+    <property name="target.name" value="BasicJS-${release.version}.swc" />
+
+    <!--
+        Windows:
+            try chrome first because it's the most popular browser
+            then, fall back to firefox
+            DON'T use internet explorer! it cannot run scripts in local pages
+    -->
+    <condition property="browser" value="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="C:/Program Files/Mozilla Firefox/firefox.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files/Mozilla Firefox/firefox.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari">
+        <os family="mac"/>
+    </condition>
+
+    <property name="report.dir" value="${basedir}/out" />
+
+    <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
+    </target>
+    
+    <target name="clean">
+        <delete failonerror="false">
+            <fileset dir="${basedir}">
+                <include name="FlexUnitRoyaleApplication.swf"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${report.dir}">
+                <include name="**/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <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="Cross-compiles tests">
+        <echo message="Cross-compiling tests"/>
+        <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
+        <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
+        <echo message="playerglobal.version: ${playerglobal.version}"/>
+
+        <!-- Load the <compc> task. We can't do this at the <project> level -->
+        <!-- because targets that run before flexTasks.jar gets built would fail. -->
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+        <!--
+            Link in the classes (and their dependencies) for the MXML tags
+            listed in this project's manifest.xml.
+            Also link the additional classes (and their dependencies)
+            listed in RoyaleUIClasses.as,
+            because these aren't referenced by the manifest classes.
+            Keep the standard metadata when compiling.
+            Include the appropriate CSS files and assets in the SWC.
+            Don't include any resources in the SWC.
+            Write a bundle list of referenced resource bundles
+            into the file bundles.properties in this directory.
+        -->
+        <mxmlc fork="true"
+            file="${basedir}/../../../../../../projects/Basic/src/test/royale/FlexUnitRoyaleApplication.mxml">
+            <jvmarg line="${mxmlc.jvm.args}"/>
+            <!--
+            <jvmarg value="-Xdebug" />
+            <jvmarg value="-Xnoagent" />
+            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8763,server=y,suspend=y" />
+             -->
+            <arg value="-debug" />
+            <arg value="-compiler.targets=JSRoyale" />
+            <arg value="-js-output=target" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+        </mxmlc>
+    </target>
+
+    <target name="test" if="browser">
+        <!-- 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}" />
+		<royaleunit
+            player="html"
+            swf="${basedir}/target/bin/js-debug/index.html"
+            command="${browser}"
+		    workingDir="${basedir}"
+		    toDir="${report.dir}"
+			haltonfailure="false"
+			verbose="true"
+			localTrusted="true"
+			timeout="90000" />
+        
+		<!-- Generate readable JUnit-style reports -->
+		<junitreport todir="${report.dir}">
+			<fileset dir="${report.dir}">
+				<include name="TEST-*.xml" />
+			</fileset>
+			<report format="frames" todir="${report.dir}/html" />
+		</junitreport>
+        
+    </target>
+</project>
diff --git a/frameworks/js/projects/CoreJS/src/test/royale/build.xml b/frameworks/js/projects/CoreJS/src/test/royale/build.xml
new file mode 100644
index 0000000..20ef544
--- /dev/null
+++ b/frameworks/js/projects/CoreJS/src/test/royale/build.xml
@@ -0,0 +1,139 @@
+<?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="CoreJS.test" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../../../../../.."/>
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${env.ROYALE_HOME}"/>
+    <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/>
+    <property name="target.name" value="CoreJS-${release.version}.swc" />
+
+    <!--
+        Windows:
+            try chrome first because it's the most popular browser
+            then, fall back to firefox
+            DON'T use internet explorer! it cannot run scripts in local pages
+    -->
+    <condition property="browser" value="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="C:/Program Files/Mozilla Firefox/firefox.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files/Mozilla Firefox/firefox.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari">
+        <os family="mac"/>
+    </condition>
+
+    <property name="report.dir" value="${basedir}/out" />
+
+    <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
+    </target>
+    
+    <target name="clean">
+        <delete failonerror="false">
+            <fileset dir="${basedir}">
+                <include name="FlexUnitRoyaleApplication.swf"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${report.dir}">
+                <include name="**/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <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="Cross-compiles tests">
+        <echo message="Cross-compiling tests"/>
+        <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
+        <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
+        <echo message="playerglobal.version: ${playerglobal.version}"/>
+
+        <!-- Load the <compc> task. We can't do this at the <project> level -->
+        <!-- because targets that run before flexTasks.jar gets built would fail. -->
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+        <!--
+            Link in the classes (and their dependencies) for the MXML tags
+            listed in this project's manifest.xml.
+            Also link the additional classes (and their dependencies)
+            listed in RoyaleUIClasses.as,
+            because these aren't referenced by the manifest classes.
+            Keep the standard metadata when compiling.
+            Include the appropriate CSS files and assets in the SWC.
+            Don't include any resources in the SWC.
+            Write a bundle list of referenced resource bundles
+            into the file bundles.properties in this directory.
+        -->
+        <mxmlc fork="true"
+            file="${basedir}/../../../../../../projects/Core/src/test/royale/FlexUnitRoyaleApplication.mxml">
+            <jvmarg line="${mxmlc.jvm.args}"/>
+            <!--
+            <jvmarg value="-Xdebug" />
+            <jvmarg value="-Xnoagent" />
+            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8763,server=y,suspend=y" />
+             -->
+            <arg value="-debug" />
+            <arg value="-compiler.targets=JSRoyale" />
+            <arg value="-js-output=target" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+        </mxmlc>
+    </target>
+
+    <target name="test" if="browser">
+        <!-- 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}" />
+		<royaleunit
+            player="html"
+            swf="${basedir}/target/bin/js-debug/index.html"
+            command="${browser}"
+		    workingDir="${basedir}"
+		    toDir="${report.dir}"
+			haltonfailure="false"
+			verbose="true"
+			localTrusted="true"
+			timeout="90000" />
+        
+		<!-- Generate readable JUnit-style reports -->
+		<junitreport todir="${report.dir}">
+			<fileset dir="${report.dir}">
+				<include name="TEST-*.xml" />
+			</fileset>
+			<report format="frames" todir="${report.dir}/html" />
+		</junitreport>
+        
+    </target>
+</project>
diff --git a/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml b/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml
new file mode 100644
index 0000000..a434f4e
--- /dev/null
+++ b/frameworks/js/projects/RoyaleUnitJS/src/test/royale/build.xml
@@ -0,0 +1,139 @@
+<?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="RoyaleUnitJS.test" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../../../../../.."/>
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${env.ROYALE_HOME}"/>
+    <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/>
+    <property name="target.name" value="RoyaleUnitJS-${release.version}.swc" />
+
+    <!--
+        Windows:
+            try chrome first because it's the most popular browser
+            then, fall back to firefox
+            DON'T use internet explorer! it cannot run scripts in local pages
+    -->
+    <condition property="browser" value="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="C:/Program Files/Mozilla Firefox/firefox.exe">
+        <and>
+            <os family="windows"/>
+            <available file="C:/Program Files/Mozilla Firefox/firefox.exe"/>
+        </and>
+    </condition>
+    <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari">
+        <os family="mac"/>
+    </condition>
+
+    <property name="report.dir" value="${basedir}/out" />
+
+    <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
+    </target>
+    
+    <target name="clean">
+        <delete failonerror="false">
+            <fileset dir="${basedir}">
+                <include name="FlexUnitRoyaleApplication.swf"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${report.dir}">
+                <include name="**/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <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="Cross-compiles tests">
+        <echo message="Cross-compiling tests"/>
+        <echo message="ROYALE_HOME: ${ROYALE_HOME}"/>
+        <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/>
+        <echo message="playerglobal.version: ${playerglobal.version}"/>
+
+        <!-- Load the <compc> task. We can't do this at the <project> level -->
+        <!-- because targets that run before flexTasks.jar gets built would fail. -->
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+        <!--
+            Link in the classes (and their dependencies) for the MXML tags
+            listed in this project's manifest.xml.
+            Also link the additional classes (and their dependencies)
+            listed in RoyaleUIClasses.as,
+            because these aren't referenced by the manifest classes.
+            Keep the standard metadata when compiling.
+            Include the appropriate CSS files and assets in the SWC.
+            Don't include any resources in the SWC.
+            Write a bundle list of referenced resource bundles
+            into the file bundles.properties in this directory.
+        -->
+        <mxmlc fork="true"
+            file="${basedir}/../../../../../../projects/RoyaleUnit/src/test/royale/FlexUnitRoyaleApplication.mxml">
+            <jvmarg line="${mxmlc.jvm.args}"/>
+            <!--
+            <jvmarg value="-Xdebug" />
+            <jvmarg value="-Xnoagent" />
+            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8763,server=y,suspend=y" />
+             -->
+            <arg value="-debug" />
+            <arg value="-compiler.targets=JSRoyale" />
+            <arg value="-js-output=target" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+        </mxmlc>
+    </target>
+
+    <target name="test" if="browser">
+        <!-- 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}" />
+		<royaleunit
+            player="html"
+            swf="${basedir}/target/bin/js-debug/index.html"
+            command="${browser}"
+		    workingDir="${basedir}"
+		    toDir="${report.dir}"
+			haltonfailure="false"
+			verbose="true"
+			localTrusted="true"
+			timeout="90000" />
+        
+		<!-- Generate readable JUnit-style reports -->
+		<junitreport todir="${report.dir}">
+			<fileset dir="${report.dir}">
+				<include name="TEST-*.xml" />
+			</fileset>
+			<report format="frames" todir="${report.dir}/html" />
+		</junitreport>
+        
+    </target>
+</project>