flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1445077 - in /flex/falcon/trunk/compiler.jx.tests: src/org/apache/flex/compiler/internal/as/codegen/ src/org/apache/flex/compiler/internal/js/codegen/goog/ test-files/ test-files/goog/ test-files/goog/files/
Date Tue, 12 Feb 2013 09:49:39 GMT
Author: erikdebruin
Date: Tue Feb 12 09:49:39 2013
New Revision: 1445077

URL: http://svn.apache.org/r1445077
Log:
Restuctured 'goog' tests a bit in order to facilitate "test projects" in addition to "test
files"

Added:
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/call-super.as
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/call-super_result.js
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/get-set.as
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/get-set.as
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/get-set_result.js
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/get-set_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/input.as
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/input.as
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/output.js
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/output.js
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/poc.as
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/poc.as
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/poc_result.js
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/poc_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/qualify-new-object.as
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as
    flex/falcon/trunk/compiler.jx.tests/test-files/goog/files/qualify-new-object_result.js
      - copied unchanged from r1439046, flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js
Removed:
    flex/falcon/trunk/compiler.jx.tests/test-files/call-super.as
    flex/falcon/trunk/compiler.jx.tests/test-files/call-super_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/get-set.as
    flex/falcon/trunk/compiler.jx.tests/test-files/get-set_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/input.as
    flex/falcon/trunk/compiler.jx.tests/test-files/output.js
    flex/falcon/trunk/compiler.jx.tests/test-files/poc.as
    flex/falcon/trunk/compiler.jx.tests/test-files/poc_result.js
    flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object.as
    flex/falcon/trunk/compiler.jx.tests/test-files/qualify-new-object_result.js
Modified:
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java?rev=1445077&r1=1445076&r2=1445077&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestBase.java
Tue Feb 12 09:49:39 2013
@@ -110,6 +110,12 @@ public class TestBase
 
     protected IFileNode getFileNode(String input, boolean isFileName)
     {
+        return getFileNode(input, isFileName, "");
+    }
+
+    protected IFileNode getFileNode(String input, boolean isFileName,
+            String inputDir)
+    {
         String tempDir = FilenameNormalization.normalize("temp"); // ensure this exists
 
         File tempASFile = null;
@@ -129,7 +135,7 @@ public class TestBase
             }
             else
             {
-                code = getCodeFromFile(input, false);
+                code = getCodeFromFile(input, false, inputDir);
             }
 
             BufferedWriter out = new BufferedWriter(new FileWriter(tempASFile));
@@ -208,12 +214,14 @@ public class TestBase
     {
     }
 
-    protected String getCodeFromFile(String fileName, boolean isJS)
+    protected String getCodeFromFile(String fileName, boolean isJS,
+            String sourceDir)
     {
         String testFileDir = FilenameNormalization.normalize("test-files");
 
         File testFile = new File(testFileDir
-                + "/" + fileName + (isJS ? ".js" : ".as"));
+                + File.separator + sourceDir + File.separator + fileName
+                + (isJS ? ".js" : ".as"));
 
         String code = "";
         try

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java?rev=1445077&r1=1445076&r2=1445077&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
Tue Feb 12 09:49:39 2013
@@ -19,6 +19,8 @@
 
 package org.apache.flex.compiler.internal.js.codegen.goog;
 
+import java.io.File;
+
 import org.apache.flex.compiler.clients.IBackend;
 import org.apache.flex.compiler.internal.as.codegen.TestWalkerBase;
 import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
@@ -37,17 +39,21 @@ public class TestGoogFile extends TestWa
     @Test
     public void testFile_plain()
     {
-        IFileNode node = getFileNode("input", true);
+        IFileNode node = getFileNode("input", true, "goog"
+                + File.separator + "files");
         visitor.visitFile(node);
-        assertOut(getCodeFromFile("output", true));
+        assertOut(getCodeFromFile("output", true, "goog"
+                + File.separator + "files"));
     }
 
     @Test
     public void testFile_getset()
     {
-        IFileNode node = getFileNode("get-set", true);
+        IFileNode node = getFileNode("get-set", true, "goog"
+                + File.separator + "files");
         visitor.visitFile(node);
-        assertOut(getCodeFromFile("get-set_result", true));
+        assertOut(getCodeFromFile("get-set_result", true, "goog"
+                + File.separator + "files"));
     }
 
     @Ignore
@@ -55,25 +61,31 @@ public class TestGoogFile extends TestWa
     public void testFile_callsuper()
     {
         // TODO (erikdebruin) handle various constructor super call edge cases first
-        IFileNode node = getFileNode("call-super", true);
+        IFileNode node = getFileNode("call-super", true, "goog"
+                + File.separator + "files");
         visitor.visitFile(node);
-        assertOut(getCodeFromFile("call-super_result", true));
+        assertOut(getCodeFromFile("call-super_result", true, "goog"
+                + File.separator + "files"));
     }
 
     @Test
     public void testFile_qualifynewobject()
     {
-        IFileNode node = getFileNode("qualify-new-object", true);
+        IFileNode node = getFileNode("qualify-new-object", true, "goog"
+                + File.separator + "files");
         visitor.visitFile(node);
-        assertOut(getCodeFromFile("qualify-new-object_result", true));
+        assertOut(getCodeFromFile("qualify-new-object_result", true, "goog"
+                + File.separator + "files"));
     }
 
     @Test
     public void testFile_poc()
     {
-        IFileNode node = getFileNode("poc", true);
+        IFileNode node = getFileNode("poc", true, "goog"
+                + File.separator + "files");
         visitor.visitFile(node);
-        assertOut(getCodeFromFile("poc_result", true));
+        assertOut(getCodeFromFile("poc_result", true, "goog"
+                + File.separator + "files"));
     }
 
     @Override



Mime
View raw message