Return-Path: X-Original-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C86CAE9AB for ; Sat, 1 Dec 2012 01:11:36 +0000 (UTC) Received: (qmail 10594 invoked by uid 500); 1 Dec 2012 01:11:36 -0000 Delivered-To: apmail-incubator-flex-commits-archive@incubator.apache.org Received: (qmail 10544 invoked by uid 500); 1 Dec 2012 01:11:36 -0000 Mailing-List: contact flex-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-commits@incubator.apache.org Received: (qmail 10532 invoked by uid 99); 1 Dec 2012 01:11:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 01:11:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 01:11:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0EDA82388A64; Sat, 1 Dec 2012 01:11:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1415903 - in /incubator/flex/falcon/trunk: ./ compiler.tests/ compiler.tests/feature-tests/mxml/tags/ Date: Sat, 01 Dec 2012 01:11:14 -0000 To: flex-commits@incubator.apache.org From: gordonsmith@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121201011115.0EDA82388A64@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gordonsmith Date: Sat Dec 1 01:11:13 2012 New Revision: 1415903 URL: http://svn.apache.org/viewvc?rev=1415903&view=rev Log: Falcon: The MXML feature tests now run the SWF in the debug FlashPlayer and check whether the SWF terminates normally with System.exit(0) or with an abnormal exit code. The tests for , , , , , , and generic instance tags like are passing in Eclipse, demonstrating correct codegen of various simple values. They are not yet part of 'ant tests'. In Falcon, 'ant eclipse' now copies the player specified by the environment variable FLASHPLAYER_DEBUGGER to the compiler.tests/temp folder so that JUnit tests running in Eclipse can find it. I updated the README to explain that you need to set FLASHPLAYER_DEBUGGER. Modified: incubator/flex/falcon/trunk/README incubator/flex/falcon/trunk/build.xml incubator/flex/falcon/trunk/compiler.tests/build.xml incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLClassTagTests.java incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLInstanceTagTestsBase.java Modified: incubator/flex/falcon/trunk/README URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/README?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/README (original) +++ incubator/flex/falcon/trunk/README Sat Dec 1 01:11:13 2012 @@ -6,7 +6,7 @@ Before trying to build Falcon, you must: 1. Build the the "develop" branch of the SDK at incubator/flex/sdk/branches/develop by doing 'ant main'. See the README there for instructions. -2. Set the environment variables JAVA_HOME, ANT_HOME, and PLAYERGLOBAL_HOME as when building the SDK. +2. Set the environment variables JAVA_HOME, ANT_HOME, PLAYERGLOBAL_HOME, and FLASHPLAYER_DEBUGGER as when building the SDK. 3. Set the environment variable JFLEX_JAR to point to the JAR file for JFlex 1.4.3. Modified: incubator/flex/falcon/trunk/build.xml URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/build.xml?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/build.xml (original) +++ incubator/flex/falcon/trunk/build.xml Sat Dec 1 01:11:13 2012 @@ -27,6 +27,7 @@ + Modified: incubator/flex/falcon/trunk/compiler.tests/build.xml URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/build.xml?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/compiler.tests/build.xml (original) +++ incubator/flex/falcon/trunk/compiler.tests/build.xml Sat Dec 1 01:11:13 2012 @@ -26,6 +26,7 @@ + @@ -33,6 +34,10 @@ + + + + Modified: incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLClassTagTests.java URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLClassTagTests.java?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLClassTagTests.java (original) +++ incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLClassTagTests.java Sat Dec 1 01:11:13 2012 @@ -29,7 +29,7 @@ import org.junit.Test; public class MXMLClassTagTests extends MXMLInstanceTagTestsBase { @Test - public void MXMLNumberTag_basic() + public void MXMLClassTag_basic() { String[] declarations = new String[] { @@ -37,7 +37,7 @@ public class MXMLClassTagTests extends M }; String[] asserts = new String[] { - "assertEqual('c1', c1 is Sprite, true);", + "assertEqual('c1', c1, Sprite);", }; String mxml = getMXML(declarations, asserts); compileAndRun(mxml); Modified: incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java (original) +++ incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java Sat Dec 1 01:11:13 2012 @@ -41,6 +41,9 @@ public class MXMLFeatureTestsBase private static final String PLAYERGLOBAL_SWC = FilenameNormalization.normalize(SDK + "\\frameworks\\libs\\player\\11.1\\playerglobal.swc"); private static final String NAMESPACE_2009 = "http://ns.adobe.com/mxml/2009"; private static final String MANIFEST_2009 = FilenameNormalization.normalize(SDK + "\\frameworks\\mxml-2009-manifest.xml"); + + // The Ant script for compiler.tests copies a standalone player to the temp directory. + private static final String FLASHPLAYER = FilenameNormalization.normalize("temp/FlashPlayer.exe"); protected void compileAndRun(String mxml) { @@ -74,6 +77,22 @@ public class MXMLFeatureTestsBase // Check that there were no compilation problems. assertThat(exitCode, is(0)); - // Coming soon-- run the SWF in the standalone player and check that there are no runtime asserts. + // Run the SWF in the standalone player amd wait until the SWF calls System.exit(). + String swf = FilenameNormalization.normalize(tempMXMLFile.getAbsolutePath()); + swf = swf.replace(".mxml", ".swf"); + args = new String[] { FLASHPLAYER, swf }; + try + { + Process process = Runtime.getRuntime().exec(args); + process.waitFor(); + exitCode = process.exitValue(); + } + catch (Exception e) + { + e.printStackTrace(); + } + + // Check that the runtime exit code was 0, meaning that no asserts failed. + assertThat(exitCode, is(0)); } } Modified: incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLInstanceTagTestsBase.java URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLInstanceTagTestsBase.java?rev=1415903&r1=1415902&r2=1415903&view=diff ============================================================================== --- incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLInstanceTagTestsBase.java (original) +++ incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLInstanceTagTestsBase.java Sat Dec 1 01:11:13 2012 @@ -45,11 +45,15 @@ public class MXMLInstanceTagTestsBase ex " private function assertEqual(message:String, actualValue:*, expectedValue:*):void", " {", " if (actualValue !== expectedValue)", + " {", " trace(message, actualValue, expectedValue);", + " System.exit(1);", + " }", " }", " private function enterFrameHandler(event:Event):void", " {", " %2", + " System.exit(0);", " }", " ]]>", " ",