本文整理匯總了Python中util.runtestBase.RuntestBase類的典型用法代碼示例。如果您正苦於以下問題:Python RuntestBase類的具體用法?Python RuntestBase怎麽用?Python RuntestBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RuntestBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: usage
def usage(self, c):
RuntestBase.usage(self, c)
print " --esc run esc instead of avm"
print " --escbin location of esc/bin directory - defaults to ../../esc/bin"
print " --ext set the testfile extension (defaults to .as)"
print " --threads number of threads to run (default=1), set to 1 to have tests finish sequentially"
exit(c)
示例2: preProcessTests
def preProcessTests(self):
RuntestBase.preProcessTests(self)
# Are we running esc - depends on a valid avm
if self.runESC:
self.runSource = True
# generate the executable cmd for esc
#escAbcs = [f for f in os.listdir(self.escbin) if f.endswith('.abc')] #not all abcs are used for esc
escAbcs = ['debug','util','bytes-tamarin','util-tamarin','lex-char','lex-token',
'lex-scan','ast','ast-decode','parse','asm','abc','emit','cogen',
'cogen-stmt','cogen-expr','esc-core','eval-support','esc-env','main']
if not self.escbin.endswith('/'):
self.escbin += '/'
for f in escAbcs:
self.avm += ' %s%s.es.abc' % (self.escbin, f)
self.avm += ' -- '
self.avm += ' %s../test/spidermonkey-prefix.es' % self.escbin #needed to run shell harness
if self.androidthreads:
p=subprocess.Popen('adb devices',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
(out,err)=p.communicate()
out = out.decode('latin_1','replace')
out = out.split('\n')
for line in out:
items=line.split()
if len(items)==2 and items[1]=='device':
for i in range(self.threads):
self.androiddevices.append(items[0])
if len(self.androiddevices)==0:
print("error: adb did not detect any attached devices")
print("adb devices stdout: %s stderr: %s" % (out,err))
sys.exit(1)
print("detected %d android devices" % (len(self.androiddevices)/self.threads))
self.threads=len(self.androiddevices)
示例3: compile_test
def compile_test(self, as_file):
if not isfile(self.shellabc):
exit("ERROR: shell.abc %s does not exist, SHELLLABC environment variable or --shellabc must be set to shell.abc" % self.shellabc)
args = []
args.append('-import %s' % self.shellabc)
if self.optimize:
args.append('-optimize')
RuntestBase.compile_test(self, as_file, args)
示例4: usage
def usage(self, c):
RuntestBase.usage(self, c)
print ' --ext set the testfile extension (defaults to .as)'
print ' --threads number of threads to run (default=# of cpu/cores), set to 1 to have tests finish sequentially'
print ' --full do a full coverage pass (all switches and options exercised)'
# print ' -i --intermediate create and compare intermediate code/AVM assembly/parse tree'
print ' -r --regex output err.actual files that are regex corrected'
exit(c)
示例5: usage
def usage(self, c):
RuntestBase.usage(self, c)
print ' --ext set the testfile extension (defaults to .as)'
print ' --threads number of threads to run (default=# of cpu/cores), set to 1 to have tests finish sequentially'
print ' --diff create and compare intermediate code/AVM assembly/parse tree to asc2'
print ' --asc2 required for diff tests - specify asc.jar to compare results to'
print ' -r --regex output err.actual files that are regex corrected'
exit(c)
示例6: usage
def usage(self, c):
RuntestBase.usage(self, c)
print ' --esc run esc instead of avm'
print ' --escbin location of esc/bin directory - defaults to ../../esc/bin'
print ' --eval use run-time compiler'
print ' --ext set the testfile extension (defaults to .as)'
print ' --ats generate ats swfs instead of running tests'
print ' --atsdir base output directory for ats swfs - defaults to ATS_SWFS'
print ' --threads number of threads to run (default=# of cpu/cores), set to 1 to have tests finish sequentially'
print ' --verify run a verify pass instead of running abcs'
exit(c)
示例7: preProcessTests
def preProcessTests(self):
RuntestBase.preProcessTests(self)
# Are we running esc - depends on a valid avm
if self.runESC:
self.runSource = True
# generate the executable cmd for esc
#escAbcs = [f for f in os.listdir(self.escbin) if f.endswith('.abc')] #not all abcs are used for esc
escAbcs = ['debug','util','bytes-tamarin','util-tamarin','lex-char','lex-token',
'lex-scan','ast','ast-decode','parse','asm','abc','emit','cogen',
'cogen-stmt','cogen-expr','esc-core','eval-support','esc-env','main']
if not self.escbin.endswith('/'):
self.escbin += '/'
for f in escAbcs:
self.avm += ' %s%s.es.abc' % (self.escbin, f)
self.avm += ' -- '
self.avm += ' %s../test/spidermonkey-prefix.es' % self.escbin #needed to run shell harness
示例8: usage
def usage(self, c):
RuntestBase.usage(self, c)
print ' --esc run esc instead of avm'
print ' --escbin location of esc/bin directory - defaults to ../../esc/bin'
print ' --eval use run-time compiler'
print ' --ext set the testfile extension (defaults to .as)'
print ' --ats generate ats swfs instead of running tests'
print ' --atsdir base output directory for ats swfs - defaults to ATS_SWFS'
print ' --threads number of threads to run (default=# of cpu/cores), set to 1 to have tests finish sequentially'
print ' --verify run a verify pass instead of running abcs'
print ' --aotsdk location of the AOT sdk used to compile tests to standalone executables.'
print ' --aotout where the resulting binaries should be put (defaults to the location of the as file).'
print ' --aotargs any extra arguments to pass to compile.py.'
print ' --remoteip IP/DNS address of the machine to run the tests on.'
print ' --remoteuser user name to use to connect to the remote machine.'
exit(c)
示例9: parseOptions
def parseOptions(self):
opts = RuntestBase.parseOptions(self)
for o, v in opts:
if o in ('--ext',):
self.sourceExt = v
elif o in ('--esc',):
self.runESC = True
elif o in ('--escbin',):
self.escbin = v
elif o in ('--eval',):
self.eval = True
elif o in ('--threads',):
self.threads=int(v)
elif o in ('--ats',):
self.genAtsSwfs = True
self.rebuildtests = True
elif o in ('--atsdir',):
self.atsDir = v
elif o in ('--verify',):
self.verify = True
self.vmargs = '-Dverifyall -Dverbose=verify'
elif o in ('--aotsdk',):
self.aotsdk = v
elif o in ('--aotout',):
self.aotout = v
elif o in ('--aotargs',):
self.aotextraargs = v
elif o in ('--remoteip',):
self.remoteip = v
elif o in ('--remoteuser',):
self.remoteuser = v
示例10: usage
def usage(self, c):
RuntestBase.usage(self, c)
print(' --esc run esc instead of avm')
print(' --escbin location of esc/bin directory - defaults to ../../esc/bin')
print(' --eval use run-time compiler')
print(' --ext set the testfile extension (defaults to .as)')
print(' --ats generate ats swfs instead of running tests')
print(' --atsdir base output directory for ats swfs - defaults to ATS_SWFS')
print(' --threads number of threads to run (default=# of cpu/cores), set to 1 to have tests finish sequentially')
print(' --passthreadid set the environment variable threadid when calling the AVM script. The threadid is an integer 0...n-1 where threads=n.')
print(' --androidthreads assign a thread for each android device connected.')
print(' --verify run a verify pass instead of running abcs')
print(' --verifyonly run a -Dverifyonly pass: only checks test exitcode')
print(' --remoteip IP/DNS address of the machine to run the tests on.')
print(' --remoteuser user name to use to connect to the remote machine.')
exit(c)
示例11: parseOptions
def parseOptions(self):
opts = RuntestBase.parseOptions(self)
for o, v in opts:
if o in ('-S', '--avm2'):
self.avm2 = v
elif o in ('--avmname',):
self.avmname = v
elif o in ('--avm2name',):
self.avm2name = v
elif o in ('-i', '--iterations'):
self.iterations = int(v)
elif o in ('-l','--log'):
self.logFileType='log'
self.createOutputFile()
elif o in ('-k', '--socketlog'):
self.logresults = True
elif o in ('-r', '--runtime'):
self.vmname = v
elif o in ('-m', '--memory'):
self.memory = True
elif o in ('--vmversion',):
self.vmversion = v
elif o in ('--vmargs2',):
self.vmargs2 = v
elif o in ('--nooptimize',):
self.optimize = False
elif o in ('--perfm',):
self.perfm = True
示例12: parseOptions
def parseOptions(self):
opts = RuntestBase.parseOptions(self)
for o, v in opts:
if o in ('--ext',):
self.sourceExt = v
elif o in ('--threads',):
self.threads=int(v)
elif o in ('-r','--regex',):
self.regexOutput = True
elif o in ('--full',):
self.fullRun = True
示例13: parseOptions
def parseOptions(self):
opts = RuntestBase.parseOptions(self)
for o, v in opts:
if o in ('--ext',):
self.sourceExt = v
elif o in ('--threads',):
self.threads=int(v)
elif o in ('-r','--regex',):
self.regexOutput = True
elif o in ('--diff',):
self.diffTesting = True
elif o in ('--asc2',):
self.asc2 = v
示例14: parseOptions
def parseOptions(self):
opts = RuntestBase.parseOptions(self)
for o, v in opts:
if o in ('--ext',):
self.sourceExt = v
elif o in ('--esc',):
self.runESC = True
elif o in ('--escbin',):
self.escbin = v
elif o in ('--eval',):
self.eval = True
elif o in ('--passthreadid',):
self.passthreadid=True
elif o in ('--androidthreads',):
self.androidthreads=True
self.threads=1
elif o in ('--threads',):
try:
self.threads=int(v)
except ValueError:
print('Incorrect threads value: %s\n' % v)
self.usage(2)
elif o in ('--ats',):
self.genAtsSwfs = True
self.rebuildtests = True
# Need to run single threaded since we create a temp file for
# every test and this file can collide when using multiple threads
self.threads = 1
elif o in ('--atsdir',):
self.atsDir = v
elif o in ('--verify',):
self.verify = True
self.vmargs = '-Dverifyall -Dverbose=verify'
elif o in ('--verifyonly',):
self.verifyonly = True
if '-Dverifyonly' not in self.vmargs:
self.vmargs += ' -Dverifyonly'
elif o in ('--remoteip',):
self.remoteip = v
elif o in ('--remoteuser',):
self.remoteuser = v
示例15: setEnvironVars
def setEnvironVars(self):
RuntestBase.setEnvironVars(self)
if "ESCBIN" in environ:
self.escbin = environ["ESCBIN"].strip()