No bug: Add the ability to specify an ASH (Actionscript compiler SHell) jar for compilation. (r=trbaker via review 888080)
authorBrent Baker <brbaker@adobe.com>
Tue, 02 Oct 2012 10:35:52 -0700
changeset 7558 9cdb18e9a83325ee36ea0fb7970c01c14f419d38
parent 7557 58be71b37b16e0c96567453930a51fdc08bc2d11
child 7559 22eb6ca016af12c342fbcf283b6de23cf29ce550
push id4260
push userdschaffe@adobe.com
push dateFri, 05 Oct 2012 17:33:23 +0000
reviewerstrbaker
bugs888080, 1119723
No bug: Add the ability to specify an ASH (Actionscript compiler SHell) jar for compilation. (r=trbaker via review 888080) If an ash jar file is not specified, the compileWithAsh() will attempt to invoke macromedia.asc.embedding.Shell in the asc jarfile. CL@1119723
test/util/runtestBase.py
--- a/test/util/runtestBase.py
+++ b/test/util/runtestBase.py
@@ -65,16 +65,17 @@ class RuntestBase(object):
     abcOnlyExt = '.abc_' # only run, don't compile these abc files - underscore is used so that tests are not deleted when removing old abc files
     abcasmExt = '.abs'
     abcasmRunner = 'bash ../../utils/abcasm/abcasm.sh'
     abcasmShell = 'abcasm/abs_helper'
     abcdump = '../../utils/abcdump'
     addtoconfig = ''
     asc = ''
     ascargs = ''
+    ash = ''
     # list of args to remove defined using -no-argname format in --ascargs
     asc_negative_args = []
     atsDir = 'ATS_SWFS'
     ascOutputFilename = 'ascoutput.log'
     ascOutputFile = None
     ascversion = ''
     avm = ''
     avmce = ''
@@ -201,16 +202,17 @@ class RuntestBase(object):
         '''Implement Me'''
         pass
 
     def usage(self, c):
         print('usage: %s [options] [tests]' % basename(argv[0]))
         print(' -v --verbose       enable additional output')
         print(' -E --avm           avmplus command to use')
         print(' -a --asc           compiler to use')
+        print('    --ash           interactive compiler to use')
         print(' -g --globalabc     DEPRECATED but still works - use builtin.abc (used to be location of global.abc)')
         print(' -b --builtinabc    location of builtin.abc')
         print(' -s --shellabc      location of shell_toplevel.abc')
         print(' -x --exclude       comma separated list of directories to skip')
         print(' -h --help          display help and exit')
         print(' -t --notime        do not generate timestamps (cleaner diffs)')
         print(' -f --forcerebuild  force rebuild all test files')
         print(' -c --config        sets the config string [default OS-tvm]')
@@ -243,17 +245,17 @@ class RuntestBase(object):
         
 
 
 
     def setOptions(self):
         '''set the valid command line options.
             When subclassing, call this method first, then append options to each list'''
         self.options = 'vE:a:g:b:s:x:htfc:dql:'
-        self.longOptions = ['verbose','avm=','asc=','globalabc=','builtinabc=','shellabc=',
+        self.longOptions = ['verbose','avm=','asc=','ash=','globalabc=','builtinabc=','shellabc=',
                    'exclude=','help','notime','forcerebuild','config=','ascargs=','vmargs=',
                    'aotsdk=', 'aotout=', 'aotargs=', 'remoteip=', 'remoteuser=',
                    'timeout=','testtimeout=', 'rebuildtests','cleanexit','quiet','notimecheck',
                    'showtimes','java=','html','random', 'seed=', 'playerglobalabc=', 'toplevelabc=',
                    'javaargs=', 'summaryonly', 'log=', 'valgrind', 'addtoconfig=',
                    'writeresult','logjunit=','logjunitname=', 'ascoutput'
                    ]
 
@@ -269,16 +271,18 @@ class RuntestBase(object):
             if o in ('-v', '--verbose'):
                 self.verbose = True
             elif o in ('-h', '--help'):
                 self.usage(0)
             elif o in ('-E', '--avm'):
                 self.avm = v
             elif o in ('-a', '--asc'):
                 self.asc = v
+            elif o in ('--ash'):
+                self.ash = v
             elif o in ('-b', '--builtinabc', '-g', '--globalabc'):
                 self.builtinabc = v
             elif o in ('-s', '--shellabc', '--toplevelabc'):
                 self.shellabc = v
             elif o in ('--playerglobalabc',):
                 self.playerglobalabc = v
             elif o in ('-x', '--exclude'):
                 self.exclude += v.split(',')
@@ -555,16 +559,18 @@ class RuntestBase(object):
                     if len(option) > 1:
                         val = self.__class__.__dict__[nm] + ' ' + val  # concat
                     self.__class__.__dict__[nm] = val
             fd.close()
 
     def setEnvironVars(self):
         if 'ASC' in environ:
             self.asc = environ['ASC'].strip()
+        if 'ASH' in environ:
+            self.ash = environ['ASH'].strip()
         if 'ASCARGS' in environ:
             self.ascargs = environ['ASCARGS'].strip()
         if 'AVM' in environ:
             self.avm = environ['AVM'].strip()
         if 'BUILTINABC' in environ:
             self.builtinabc = environ['BUILTINABC'].strip()
         if 'CONFIG' in environ:
             self.config = environ['CONFIG'].strip()
@@ -1227,17 +1233,21 @@ class RuntestBase(object):
                     self.ashErrors.append("abc files %s.abc not created" % (testdir))
                     continue
 
                 if self.aotsdk: # ABC compiled, so now AOT compile
                     # Need to figure out how to deal with additional required abc files
                     self.compile_aot(testdir+".abc")
 
         else:  #pexpect available
-            child = pexpect.spawn('"%s" %s -classpath %s macromedia.asc.embedding.Shell' % (self.java, self.javaargs, self.asc))
+            if isfile(self.ash):
+                child = pexpect.spawn('"%s" %s -jar %s ' % (self.java, self.javaargs, self.ash))
+            else:
+                child = pexpect.spawn('"%s" %s -classpath %s macromedia.asc.embedding.Shell' % (self.java, self.javaargs, self.asc))
+                
             child.logfile = None
             if self.verbose:
                 child.logfile = sys.stdout
             child.expect("\(ash\)")
             child.expect("\(ash\)")
 
             for test in tests:
                 self.js_print('compiling %s' % test)