Repository: flex-sdk
Updated Branches:
  refs/heads/develop 815e105a4 -> 1f8c801d3


Fix for FLEX-34323.
Allow mustella test directory to be located at a directory defined by the 
environment variable "MUSTELLA_TEST_DIR".
Use FLEX_HOME for sdk.dir with a fallback of "${basedir}/.."
Look for cygwin shell in /cygwin64/bin/sh.exe as well as /cygwin/bin/sh.
Add init() method documentation to README file.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/1f8c801d
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1f8c801d
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1f8c801d

Branch: refs/heads/develop
Commit: 1f8c801d33406b7f1f6119fe93788f0c30fd5c73
Parents: 815e105
Author: dloverin <darrell.love...@gmail.com>
Authored: Mon Aug 18 21:46:03 2014 -0400
Committer: dloverin <darrell.love...@gmail.com>
Committed: Mon Aug 18 21:46:03 2014 -0400

----------------------------------------------------------------------
 mustella/README                                 |  23 ++++
 .../as3/src/mustella/ExcludeFileLocation.as     | 117 +++++++++--------
 .../src/mustella/ExcludeFileLocationApollo.as   | 131 +++++++++++--------
 mustella/as3/src/mustella/UnitTester.as         |  17 ++-
 mustella/build.xml                              |  55 ++++----
 .../java/src/mustella/CompileMustellaSwfs.java  |  25 ++--
 mustella/mini_run.sh                            |  10 +-
 7 files changed, 230 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/README
----------------------------------------------------------------------
diff --git a/mustella/README b/mustella/README
index 39f0509..d3c3570 100644
--- a/mustella/README
+++ b/mustella/README
@@ -60,3 +60,26 @@ Basic Commands
                ./mini_run.sh -caseName=datagrid_properties_columns_0 
tests/components/DataGrid/DataGrid_SparkSkin/Properties/datagrid_properties_columns.mxml
 
        This command runs a specific test case from a specific test file.
+
+Alternate Location of Test Files
+================================
+       You can create Mustella tests for your own components and put them in 
your own test directory outside of the Flex SDK and Mustella source 
directories. To do this set the MUSTELLA_TEST_DIR environment variable to the 
absolute path of the directory containing your tests. Your test directory will 
need to include the exclude files (ExcludeList*.txt) for the platforms you are 
testing on but the files may be empty if you have no tests to exclude. After 
setting MUSTELLA_TEST_DIR, mini_run.sh will look in the new directory for tests 
to run instead of the 'tests' subdirectory of mustella.
+
+       To support finding the location of the exclude file during test 
execution some changes to a test script’s init() method are required. The 
requirement is the UnitTester.mustellaTestDir property must be set to the url 
of the test directory. Below is code that sets UnitTester.mustellaTestDir using 
a relative path from the test script.
+
+            import mx.core.FlexGlobals;
+            import mx.utils.LoaderUtil;
+            
+            public static function init(o:DisplayObject):void
+            {
+                // Set the directory where the exclude file loads.
+                var url:String =  
LoaderUtil.createAbsoluteURL(o.loaderInfo.url, "../../../");
+                if (!url)
+                    throw new Error("could not find mustella test directory");
+
+                if (url.charAt(url.length - 1) == "/")
+                    url = url.substring(0, url.length - 1);
+      
+                mustellaTestDir = url;
+            }  
+

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/as3/src/mustella/ExcludeFileLocation.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/ExcludeFileLocation.as 
b/mustella/as3/src/mustella/ExcludeFileLocation.as
index 268cfef..7b5ee20 100644
--- a/mustella/as3/src/mustella/ExcludeFileLocation.as
+++ b/mustella/as3/src/mustella/ExcludeFileLocation.as
@@ -19,9 +19,9 @@
 package {
 
 import flash.display.DisplayObject;
+import flash.events.Event;
 import flash.net.URLLoader;
 import flash.net.URLRequest;
-import flash.events.Event;
 import flash.system.Capabilities;
 
 [Mixin]
@@ -40,7 +40,7 @@ public class ExcludeFileLocation
        private static var loader:URLLoader;
 
        public static var url:String;
-       public static var mustellaDir:String;
+       public static var mustellaTestDir:String;
 
        public static var frontURL:String;
        public static var domain:String;
@@ -65,51 +65,59 @@ public class ExcludeFileLocation
 
                trace ("Hello from excludes at: " + new Date());
 
-
-               var os:String = Capabilities.os;
-
-
-               if (os.indexOf ("Windows") != -1) 
-               {
-                       excludeFile = "ExcludeListWin.txt";
-               } else if (os.indexOf ("Mac") != -1) 
-               {
-                       excludeFile = "ExcludeListMac.txt";
-               } else if (os.indexOf ("Linux") != -1) 
-               {
-                       excludeFile = "ExcludeListLinux.txt";
-               } else 
-               {               
-                       trace ("Excludes: bad: we didn't see an OS we liked: " 
+ os);
-                       excludeFile = "ExcludeListWin.txt";
-               }
-
-
-               _root = root;
-
-               url = root.loaderInfo.url;
-
-               mustellaDir = url.substring (0, url.indexOf 
("mustella/tests")+14);
-
-               frontURL = url.substring (0, url.indexOf (":"));
-
-               domain = url.substring (url.indexOf (":")+3);
-               domain = domain.substring (0, domain.indexOf ("/"));
-
-               if (Capabilities.playerType == "PlugIn" || 
Capabilities.playerType == "ActiveX")
-               { 
-                       loadTryBrowser();
-               } else
-               {
-                       loadTryNormal();
-
-               } 
-
-       }
-
-
-
-       public static function loadTryBrowser():void
+       _root = root;
+
+        // set up callback to load excludes after 
+        // UnitTester has initialized.
+        UnitTester.loadExcludeFile = loadExcludeFile;   
+
+    }
+
+    public static function loadExcludeFile():void
+    {
+        var os:String = Capabilities.os;
+        
+        
+        if (os.indexOf ("Windows") != -1) 
+        {
+            excludeFile = "ExcludeListWin.txt";
+        } else if (os.indexOf ("Mac") != -1) 
+        {
+            excludeFile = "ExcludeListMac.txt";
+        } else if (os.indexOf ("Linux") != -1) 
+        {
+            excludeFile = "ExcludeListLinux.txt";
+        } else 
+        {              
+            trace ("Excludes: bad: we didn't see an OS we liked: " + os);
+            excludeFile = "ExcludeListWin.txt";
+        }
+        
+        url = _root.loaderInfo.url;
+        
+        // allow application to override mustella test dir
+        if (!UnitTester.mustellaTestDir)
+            mustellaTestDir = url.substring (0, url.indexOf 
("mustella/tests")+14);
+        else
+            mustellaTestDir = UnitTester.mustellaTestDir;
+        
+        frontURL = url.substring (0, url.indexOf (":"));
+        
+        domain = url.substring (url.indexOf (":")+3);
+        domain = domain.substring (0, domain.indexOf ("/"));
+        
+        if (Capabilities.playerType == "PlugIn" || Capabilities.playerType == 
"ActiveX")
+        { 
+            loadTryBrowser();
+        } else
+        {
+            loadTryNormal();
+            
+        } 
+        
+    }
+
+    public static function loadTryBrowser():void
        {
                trace ("excludes loadTryBrowser at: " + new Date().toString());
 
@@ -148,10 +156,9 @@ public class ExcludeFileLocation
        { 
        
                trace ("Exclude: in the web read error handler");
-               if (!triedNormal) 
+        if (!triedNormal) 
                {
-                       loadTryNormal();        
-
+                       loadTryNormal();
                }
 
        }
@@ -166,11 +173,11 @@ public class ExcludeFileLocation
 
                var useFile:String;
 
-               useFile = mustellaDir +"/" + excludeFile;
+               useFile = mustellaTestDir +"/" + excludeFile;
 
                trace ("Exclude: try load from: " + useFile);
 
-               var req:URLRequest = new URLRequest(useFile);
+        var req:URLRequest = new URLRequest(useFile);
                loader = new URLLoader();
                loader.addEventListener("complete", completeHandler2);
                loader.addEventListener("ioError", errorHandler2);
@@ -181,8 +188,8 @@ public class ExcludeFileLocation
 
        private static function errorHandler2(event:Event):void
        {
-               trace ("Exclude: error in the exclude file load " +event);      
-               if (!triedBrowser) 
+               trace ("Exclude: error in the exclude file load " +event);
+        if (!triedBrowser) 
                {
                        loadTryBrowser();
                }
@@ -192,7 +199,7 @@ public class ExcludeFileLocation
 
        private static function completeHandler2(event:Event):void
        {
-               trace ("Excludes: Reading from file system at "+mustellaDir );
+               trace ("Excludes: Reading from file system at "+mustellaTestDir 
);
                postProcessData(event);
        }
        private static function postProcessData(event:Event):void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/as3/src/mustella/ExcludeFileLocationApollo.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/ExcludeFileLocationApollo.as 
b/mustella/as3/src/mustella/ExcludeFileLocationApollo.as
index 73f730e..56bb0a4 100644
--- a/mustella/as3/src/mustella/ExcludeFileLocationApollo.as
+++ b/mustella/as3/src/mustella/ExcludeFileLocationApollo.as
@@ -41,7 +41,7 @@ public class ExcludeFileLocationApollo
        private static var loader:URLLoader;
 
        private static var url:String;
-       private static var mustellaDir:String;
+       private static var mustellaTestDir:String;
 
        private static var frontURL:String;
        private static var domain:String;
@@ -66,64 +66,79 @@ public class ExcludeFileLocationApollo
 
                trace ("Hello from excludes at: " + new Date());
 
-               var os:String = Capabilities.os;
+        _root = root;
+            
+        // set up callback to load excludes after 
+        // UnitTester has initialized.
+        UnitTester.loadExcludeFile = loadExcludeFile;   
+        
+       }
 
-               // This seems to be a timing issue which pops up on some 
machines.
-               if( UnitTester.cv == null ){
-                       UnitTester.cv = new ConditionalValue();
-               }
 
-               if( (UnitTester.cv.os != null) && 
(UnitTester.cv.os.toLowerCase() == DeviceNames.ANDROID.toLowerCase()) ){
-                       mustellaDir = "..";
-                       excludeFile = UnitTester.excludeFile;
-                       trace("Doing Android style exclude.  Checking in " + 
mustellaDir + "/" + excludeFile);
-               }else if( (UnitTester.cv.os != null) && 
(UnitTester.cv.os.toLowerCase() == DeviceNames.IOS.toLowerCase()) ){
-                       mustellaDir = File.documentsDirectory.url;
-                       excludeFile = UnitTester.excludeFile;
-               }else if (os.indexOf ("QNX") > -1) {
-                       mustellaDir = "..";
-                       excludeFile = UnitTester.excludeFile;
-                       trace("Doing QNX style exclude.  Checking in " + 
mustellaDir + "/" + excludeFile);
-               }
-               else{
-
-                       if (os.indexOf ("Windows") != -1) 
-                       {
-                               excludeFile = "ExcludeListWinAIR.txt";
-                       } else if (os.indexOf ("Mac") != -1) 
-                       {
-                               excludeFile = "ExcludeListMacAIR.txt";
-                       } else if (os.indexOf ("Linux") != -1) 
-                       {
-                               excludeFile = "ExcludeListLinux.txt";
-                       } else 
-                       {               
-                               trace ("Excludes: bad: we didn't see an OS we 
liked: " + os);
-                               excludeFile = "ExcludeListWin.txt";
-                       }
-
-                       _root = root;
-
-                       url = root.loaderInfo.url;
-
-                       if (url.indexOf("app:")!=-1) 
-                       {
-                               ApolloFilePath.init (root);
-                                                       url = 
encodeURI2(ApolloFilePath.apolloAdjust(url));
-                               trace ("Adjusting path for AIR to: " + url);
-                                                  // url = adjustPath(url);
-                       }
-
-                       mustellaDir = url.substring (0, url.indexOf 
("mustella/tests")+14);
-                       frontURL = url.substring (0, url.indexOf (":"));
-                       domain = url.substring (url.indexOf (":")+3);           
-                       domain = domain.substring (0, domain.indexOf ("/"));
-               }
-               
-               loadTryNormal();
-       }
+    public static function loadExcludeFile():void
+    {
+        var os:String = Capabilities.os;
+        
+        // This seems to be a timing issue which pops up on some machines.
+        if( UnitTester.cv == null ){
+            UnitTester.cv = new ConditionalValue();
+        }
+        
+        if( (UnitTester.cv.os != null) && (UnitTester.cv.os.toLowerCase() == 
DeviceNames.ANDROID.toLowerCase()) ){
+            mustellaTestDir = "..";
+            excludeFile = UnitTester.excludeFile;
+            trace("Doing Android style exclude.  Checking in " + 
mustellaTestDir + "/" + excludeFile);
+        }else if( (UnitTester.cv.os != null) && 
(UnitTester.cv.os.toLowerCase() == DeviceNames.IOS.toLowerCase()) ){
+            mustellaTestDir = File.documentsDirectory.url;
+            excludeFile = UnitTester.excludeFile;
+        }else if (os.indexOf ("QNX") > -1) {
+            mustellaTestDir = "..";
+            excludeFile = UnitTester.excludeFile;
+            trace("Doing QNX style exclude.  Checking in " + mustellaTestDir + 
"/" + excludeFile);
+        }
+        else{
+            
+            if (os.indexOf ("Windows") != -1) 
+            {
+                excludeFile = "ExcludeListWinAIR.txt";
+            } else if (os.indexOf ("Mac") != -1) 
+            {
+                excludeFile = "ExcludeListMacAIR.txt";
+            } else if (os.indexOf ("Linux") != -1) 
+            {
+                excludeFile = "ExcludeListLinux.txt";
+            } else 
+            {          
+                trace ("Excludes: bad: we didn't see an OS we liked: " + os);
+                excludeFile = "ExcludeListWin.txt";
+            }
+            
+            url = _root.loaderInfo.url;
+            
+            if (url.indexOf("app:")!=-1) 
+            {
+                ApolloFilePath.init (_root);
+                url = encodeURI2(ApolloFilePath.apolloAdjust(url));
+                trace ("Adjusting path for AIR to: " + url);
+                // url = adjustPath(url);
+            }
+            
+            // allow application to override mustella test dir
+            if (!UnitTester.mustellaTestDir)
+                mustellaTestDir = url.substring (0, url.indexOf 
("mustella/tests")+14);
+            else
+                mustellaTestDir = UnitTester.mustellaTestDir;
+            
+            frontURL = url.substring (0, url.indexOf (":"));
+            domain = url.substring (url.indexOf (":")+3);              
+            domain = domain.substring (0, domain.indexOf ("/"));
+        }
+        
+        loadTryNormal();
+        
+    }
 
-       private static function apolloAdjust(url:String):String
+    private static function apolloAdjust(url:String):String
        {
 
                var swf:String = _root.loaderInfo.url;
@@ -227,7 +242,7 @@ public class ExcludeFileLocationApollo
 
                var useFile:String;
 
-               useFile = mustellaDir +"/" + excludeFile;
+               useFile = mustellaTestDir +"/" + excludeFile;
 
                trace ("Exclude: try load from: " + useFile);
 
@@ -253,7 +268,7 @@ public class ExcludeFileLocationApollo
 
        private static function completeHandler2(event:Event):void
        {
-               trace ("Excludes: Reading from file system at "+mustellaDir );
+               trace ("Excludes: Reading from file system at "+mustellaTestDir 
);
                postProcessData(event);
        }
        private static function postProcessData(event:Event):void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/as3/src/mustella/UnitTester.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/UnitTester.as 
b/mustella/as3/src/mustella/UnitTester.as
index a558b58..37fe2a1 100644
--- a/mustella/as3/src/mustella/UnitTester.as
+++ b/mustella/as3/src/mustella/UnitTester.as
@@ -95,6 +95,18 @@ public class UnitTester extends EventDispatcher
        **/
        public static var excludeFile:String = "";
 
+    /**
+     *  The location of the mustella test directory.
+     */
+    public static var mustellaTestDir:String = "";
+    
+    /**
+     *  Set by either ExcludeFileLocation or ExcludeFileLocationApollo so they
+     *  can be called back to load the exclude file after mustellaTestDir has 
+     *  been set in the init() method.
+     */
+    public static var loadExcludeFile:Function;
+    
        /**
        * This is a placeholder.  We don't do portrait and landscape runs right 
now
        * and probablay won't.  Delete.
@@ -153,6 +165,9 @@ public class UnitTester extends EventDispatcher
        public static function init(root:DisplayObject):void
        {
        
+        if (waitForExcludes && loadExcludeFile != null)
+            loadExcludeFile();
+        
                // don't let child swfs override this
                if (!_root)
                        _root = root;
@@ -351,7 +366,7 @@ public class UnitTester extends EventDispatcher
                                var q:QName = new QName(mx_internal, 
"hideCursor");
                                g[q] = true;
                        }
-               }               
+               }       
        }
 
        /**

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/build.xml
----------------------------------------------------------------------
diff --git a/mustella/build.xml b/mustella/build.xml
index 6183026..12c5e0a 100644
--- a/mustella/build.xml
+++ b/mustella/build.xml
@@ -22,12 +22,15 @@
     <!-- Load the local properties.  Need sdk.dir to load the Flex config env 
vars.  -->
     <property name="local_properties" value="local.properties" />
     <property file="${basedir}/${local_properties}" />
-    <property name="sdk.dir" value="${basedir}/.." />
-    
-    <property file="${sdk.dir}/env.properties"/>
     <property environment="env"/>
 
-    <pathconvert property="mustella.dir" dirsep="/" >
+    <condition property="sdk.dir" value="${env.FLEX_HOME}" 
else="${basedir}/..">
+        <isset property="env.FLEX_HOME"/>
+    </condition>
+        
+    <property file="${sdk.dir}/env.properties"/>
+
+       <pathconvert property="mustella.dir" dirsep="/" >
        <path location="${basedir}" />
     </pathconvert>
 
@@ -64,7 +67,10 @@
     <property name="apollo_transform_template" 
value="${mustella.dir}/Assets/AirTransform/WindowedAppTemplate.mxml" />
     <property name="previous.generated.testfiles" 
value="**/*.swf,**/*.output,**/SWFs/${apollo_transform_prefix}*.mxml,**/swfs/${apollo_transform_prefix}*.mxml,**/SWFs/${apollo_transform_prefix2}*.mxml,**/swfs/${apollo_transform_prefix2}*.mxml"
 />
     
-    <property name="sdk.mustella.dir" value="${mustella.dir}/tests" />
+    <condition property="sdk.mustella.dir" value="${env.MUSTELLA_TEST_DIR}" 
else="${mustella.dir}/tests">
+           <isset property="env.MUSTELLA_TEST_DIR"/>
+    </condition>
+
     <!-- 
         This directory doesn't exist in the source kit so make it although it 
would be better
         to make sure no targets that the source kit uses expect this directory 
to exist.
@@ -95,7 +101,9 @@
     <property name="strict" value="true" />
     <property name="exit_on_compile_error" value="" />
 
-    <property name="cygwinshell" value="/cygwin/bin/sh.exe" />
+       <available file="/cygwin/bin/sh.exe" property="cygwinshell" 
value="/cygwin/bin/sh.exe"/>
+    <available file="/cygwin64/bin/sh.exe" property="cygwinshell" 
value="/cygwin64/bin/sh.exe"/>
+       
     <property name="buildURL" value="true" />
 
     <property name="classes.dir" value="${mustella.dir}/classes" />
@@ -169,7 +177,7 @@
     <!-- Mobile stuff will be changed by handle_mobile_config later if it's a 
mobile run. -->
     <property name="target_os_name" value="${host_os_name}" />
 
-    <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeListWin.txt" >
+    <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeListWin.txt" >
         <and>
             <equals arg1="${target_os_name}" arg2="windows" />
             <not>
@@ -178,7 +186,7 @@
         </and>
     </condition>
 
-    <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeListMac.txt" >
+    <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeListMac.txt" >
         <and>
             <equals arg1="${target_os_name}" arg2="mac" />
             <not>
@@ -187,21 +195,21 @@
         </and>
     </condition>
     
-    <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeListMacAIR.txt" >
+    <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeListMacAIR.txt" >
         <and>
             <equals arg1="${target_os_name}" arg2="mac" />
             <istrue value="${use_apollo}" />
         </and>
     </condition>
 
-    <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeListWinAIR.txt" >
+    <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeListWinAIR.txt" >
         <and>
             <equals arg1="${target_os_name}" arg2="windows" />
             <istrue value="${use_apollo}" />
         </and>
     </condition>
 
-    <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeListLinux.txt" >
+    <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeListLinux.txt" >
         <equals arg1="${target_os_name}" arg2="Linux" />
     </condition>
 
@@ -657,10 +665,11 @@
             <path path="${tmp.sdk.mustella.scripts2}" />
         </pathconvert>
         <exec  executable="${shell}" failonerror="${exit_on_compile_error}">
-            <arg value="${sdk.mustella.dir}/../scripts/shellrunner.sh" />
+            <arg value="${mustella.dir}/scripts/shellrunner.sh" />
             <env key="MUSTELLA_SCRIPTS2" value="${sdk.mustella.scripts2}" />
             <env key="SDK_DIR" value="${sdk.dir}" />
             <env key="MUSTELLA_DIR" value="${mustella.dir}" />
+            <env key="MUSTELLA_TEST_DIR" value="${sdk.mustella.dir}" />
             <env key="USE_APOLLO" value="${use_apollo}" />
             <env key="APOLLO_TRANSFORM" value="${apollo_transform}" />
         </exec>
@@ -697,7 +706,7 @@
         <taskdef name="getrunidtask" classname="mustella.GetRunIdTask" 
classpathref="flex.test.classpath"/>
         <getrunidtask  host="host" property="current.run.id" 
build="${build.id}" branch="${branch_name}" type="${run_type}" 
browserName="${browser_name}" config="${config_id}" swf="${version_fetcher}" 
player="${player}" time="${db_time}" os="${os}" osVersion="${os_version}" 
arch="${arch}"/>
         <echo message="yo yo yo new id: ${current.run.id}" />
-        <echo file="${mustella.dir}/tests/runid.properties" 
append="false">run_id=${current.run.id}</echo>
+        <echo file="${sdk.mustella.dir}/runid.properties" 
append="false">run_id=${current.run.id}</echo>
 
         <!-- read the file, make sure we match -->
 
@@ -729,7 +738,7 @@
     </condition>
     
     <target name="handle_mobile_config" depends="get_mobile_data,device_fail" 
if="do_handle_mobile_config" >
-        <condition property="exclude_filename" 
value="${mustella.dir}/tests/ExcludeList${os}.txt" >
+        <condition property="exclude_filename" 
value="${sdk.mustella.dir}/ExcludeList${os}.txt" >
             <equals arg1="${run_mobile_tests}" arg2="true" />
         </condition>
         
@@ -890,7 +899,7 @@
         <echo message="Deleting old results and files from previous testsuite 
build."/>
         <delete dir="${mustellagen.dir}" quiet="true"/>
         <!-- get rid of old runid prop file, in case we don't create a new one 
-->
-        <delete verbose="true" file="${mustella.dir}/tests/runid.properties" 
failonerror="false" quiet="true" />
+        <delete verbose="true" file="${sdk.mustella.dir}/runid.properties" 
failonerror="false" quiet="true" />
         <!-- delete file="${mustella.dir}/mustella.swc" failonerror="false"/ 
-->
         <delete quiet="true" failonerror="false" includeEmptyDirs="true">
             <fileset dir="${mustella.dir}">
@@ -944,7 +953,7 @@
                 <exclude 
name="RuntimeLocalization/RTL_SparkSkin/SWFs/Assets/bundles/flex20/enCustomBundle2_Flex20.swc"/>
             </fileset>
         </delete>
-        <delete dir="tests/MarshallPlan/SWFs/assets/MyUtils"/>
+        <delete dir="${sdk.mustella.dir}/MarshallPlan/SWFs/assets/MyUtils"/>
     </target>
 
    <property name="exclude_flag" value="" />
@@ -1115,21 +1124,21 @@
         <delete quiet="true">
             <fileset dir="${sdk.dir}/frameworks/componentSmoke" 
includes="*.cache"/>
         </delete>
-        <property name="frameworks.dir" value="${mustella.dir}/../frameworks" 
/>
+        <property name="frameworks.dir" value="${sdk.dir}/frameworks" />
         <property name="mxmlc.dir" value="${sdk.dir}/bin" />
         <!-- property name="mxmlc.exe" value="mxmlc.exe" / -->
         <!-- remove? property name="pfchange" value="workspace" / -->
         <pathconvert pathSep=";" property="sdk.mustella.mxmlfiles" 
refid="sdk.mustella.fileset"/>
 
-        <!-- echo>stuff we're passing into compile: 
${sdk.mustella.mxmlfiles}</echo -->
+        <!-- <echo>stuff we're passing into compile: 
${sdk.mustella.mxmlfiles}</echo> -->
     
-        <!-- echo>Shell is currently ${shell}</echo -->
+        <!-- <echo>Shell is currently ${shell}</echo> -->
         <antcall target="shells" />
     
         <!-- write the target files to a file -->
         <taskdef name="namesToFile" classname="mustella.WriteFileNames" 
classpathref="flex.test.classpath"/>
         <namesToFile list="${sdk.mustella.mxmlfiles}" 
file="${mustella.dir}/test_files.tmp"/>
-    
+       
         <java classname="mustella.CompileMustellaSwfs" fork="${fork_compile}" 
resultproperty="jreturn" >
             <classpath refid="flex.test.classpath"/>
             <sysproperty key="mxmlcdir" value="${mxmlc.dir}" />
@@ -1364,7 +1373,7 @@
     <target name="zip_tests_only"  depends="makemustellaswc" description="- 
package tests,jars,excludes, and results">
 
         <!-- assumption: we have a runid; we need it to get the failures 
relevant to the current build -->
-        <property file="${mustella.dir}/tests/runid.properties" />
+        <property file="${sdk.mustella.dir}/runid.properties" />
         <property name="current.run.id" value="${run_id}" />
     
         <echo>run id is ${current.run.id} </echo>
@@ -1439,7 +1448,7 @@
     </target>
 
     <target name="unzipSwfs" description="Unzip previously compiled test swfs" 
>
-        <unzip src="${mustella.dir}/${testpkg}" dest="${mustella.dir}/tests" />
+        <unzip src="${mustella.dir}/${testpkg}" dest="${sdk.mustella.dir}" />
     </target>
 
 
@@ -1910,7 +1919,7 @@
         <chmod perm="777" verbose="true" dir="${sdk.dir}/frameworks" 
includes="*" >
         </chmod>
         <chmod perm="777" verbose="true" maxparallel="50">
-            <dirset dir="${mustella.dir}/tests"  >
+            <dirset dir="${sdk.mustella.dir}"  >
             </dirset>
         </chmod>
         <antcall target="delete_cache">

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/java/src/mustella/CompileMustellaSwfs.java
----------------------------------------------------------------------
diff --git a/mustella/java/src/mustella/CompileMustellaSwfs.java 
b/mustella/java/src/mustella/CompileMustellaSwfs.java
index 2f65d6b..ba2872e 100644
--- a/mustella/java/src/mustella/CompileMustellaSwfs.java
+++ b/mustella/java/src/mustella/CompileMustellaSwfs.java
@@ -107,6 +107,8 @@ public class CompileMustellaSwfs extends Thread {
 
     private static String mustella_framework_dir = null;
 
+    private static String mustella_test_dir = null;
+
     private static String apollo_location = ""; 
 
     private static String file_of_tests = "";
@@ -321,6 +323,11 @@ public class CompileMustellaSwfs extends Thread {
                } catch (Exception e) { 
                }
 
+               try {
+                       mustella_test_dir = System.getProperty 
("sdk.mustella.dir");
+               } catch (Exception e) { 
+               }
+
                try { 
                        flex_version = Double.parseDouble(System.getProperty 
("flex_version"));
                } catch (Exception e) { 
@@ -398,7 +405,6 @@ public class CompileMustellaSwfs extends Thread {
 
                }
 
-
                if (System.getProperty ("socket_mixin")!=null) { 
                        socket_mixin = System.getProperty ("socket_mixin");
                        if (socket_mixin != null && !socket_mixin.equals (""))
@@ -697,7 +703,6 @@ public class CompileMustellaSwfs extends Thread {
 
        /// System.out.println ("This is the filename I've fixed: " + s);
 
-
        return "-includes=" +s;
 
     }
@@ -867,8 +872,10 @@ public class CompileMustellaSwfs extends Thread {
                        }
                }
 
-               front = front.substring (front.indexOf("mustella" + 
File.separator + "tests")+15);
                front = front.replaceAll ("\\\\", "/") + "/";
+               int test_index = front.indexOf(mustella_test_dir);
+               int test_length = mustella_test_dir.length();
+               front = front.substring (test_index + test_length + 1);
 
                alinc.add ("\"" + transformName( front + extract, "") + "\": 
1,");
                alinc.add ("\"" + transformName( front + extract, "") + "$" + 
include_list + "\": 1");
@@ -1038,20 +1045,20 @@ public class CompileMustellaSwfs extends Thread {
 
                compiler.setDir(dir);
 
-               /**
+               /**     
                System.out.println ("************");
                System.out.println ("************");
                
                String defaultArgsDebugString = new String();
                
-               for(int i = 0; i < defaultArgs.length; ++i){
-                       defaultArgsDebugString += defaultArgs[i];
+               for(int i = 0; i < defaultArgs.size(); ++i){
+                       defaultArgsDebugString += defaultArgs.get(i);
                }
-               
+
                System.out.println ("mxml: " + mxml);
                System.out.println ("defaultArgs: " + defaultArgsDebugString);
                **/
-               
+
                compiler.compile(mxml, defaultArgs);
                RuntimeExecHelper rh = compiler.getRuntimeExecHelper();
 
@@ -1061,7 +1068,7 @@ public class CompileMustellaSwfs extends Thread {
                // System.out.println("rh output: " + rh.getOutputText());
                // System.out.println("rh error out: " + rh.getErrorText());
                // System.out.println("exit value=" + rh.getExitValue());
-
+               
                String failedFile=null;
 
                // InsertErrorResult ier = null;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1f8c801d/mustella/mini_run.sh
----------------------------------------------------------------------
diff --git a/mustella/mini_run.sh b/mustella/mini_run.sh
index 96e9139..5aeca2e 100755
--- a/mustella/mini_run.sh
+++ b/mustella/mini_run.sh
@@ -551,10 +551,16 @@ do
         ### set a -D property for ant run_this_script. 
         ### otherwise, run a whole directory
         ### the other args are the same, however. :(
+        mustellaTestDir=${MUSTELLA_TEST_DIR}
 
-        tmpx=tests/${i}
-        # echo "Looking for $tmpx"
+        if [ ! -d "$mustellaTestDir" ]
+            then
+            mustellaTestDir="tests";
+        fi
 
+        tmpx=$mustellaTestDir/${i}
+        
+        # echo "Looking for $tmpx"
         end=`echo $tmpx | awk -F"." '{print $NF}'`
 
         if [ ! -f "$tmpx" ] && [ ! -d "$tmpx" ]

Reply via email to