rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
jit_flags = [ '-m' ]
jit_flags = [ '-m', '-j' ]
def get_test_cmd(path, lib_dir): libdir_var = lib_dir if not libdir_var.endswith('/'): libdir_var += '/' expr = "const platform=%r; const libdir=%r;"%(sys.platform, libdir_var) if OPTIONS.methodjit_only: jit_flags = [ '-m' ] else: jit_flags = [ '-m' ] return [ JS ] + jit_flags + [ '-e', expr, '-f', os.path.join(lib_dir...
processincoming = MethodDefn( MethodDecl('FlushPendingRPCQueue', ret=Type.VOID)) processincoming.addstmt(StmtExpr(ExprCall(ExprSelect(_actorChannel(ExprVar.THIS), '.', 'FlushPendingRPCQueue'))))
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...
onstack, processincoming, Whitespace.NL ])
onstack, Whitespace.NL ])
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...
if True and stdout:
if self.logfiles and stdout:
def print_stdout(stdout): """Print stdout line-by-line to avoid overflowing buffers.""" print ">>>>>>>" for line in stdout.splitlines(): print line print "<<<<<<<"
and filecmp.cmp(relative_name, original_name)):
and filecmp.cmp(relative_name, original_name, False)):
def check(copy, original, ignore): os.chdir(copy) for (dirpath, dirnames, filenames) in os.walk('.'): exceptions = read_exceptions(join(dirpath, 'check-sync-exceptions')) for dirname in dirnames: if (dirname in exceptions): dirnames.remove(dirname) break for filename in filenames: if (filename in exceptions) or fnmatch...
success = call(["makecab.exe", full_path, compressed_file], stdout=open("NUL:","w"), stderr=STDOUT)
success = call(["makecab.exe", "/D", "CompressionType=LZX", "/D", "CompressionMemory=21", full_path, compressed_file], stdout=open("NUL:","w"), stderr=STDOUT)
def CopyDebug(self, file, debug_file, guid): rel_path = os.path.join(debug_file, guid, debug_file).replace("\\", "/") full_path = os.path.normpath(os.path.join(self.symbol_path, rel_path)) shutil.copyfile(file, full_path) # try compressing it compressed_file = os.path.splitext(full_path)[0] + ".pd_" # ignore makecab's ...
[ Label.PRIVATE ]
[ Label.PUBLIC ]
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
preprocess_locale_files(argv[1], argv[2], argv[4], argv[4])
preprocess_locale_files(argv[1], argv[2], argv[3], argv[4])
def preprocess_locale(argv): """ Validates command line arguments and displays usage if necessary """ if len(argv) < 1 or (argv[0] != '--convert-utf8-utf16le' and argv[0] != '--preprocess-locale'): sys.stderr.write("""
f.write(" JSAutoTempValueRooter tvr(cx);\n")
f.write(" js::AutoValueRooter tvr(cx);\n")
def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False): """ Write a single quick stub (a custom SpiderMonkey getter/setter/method) for the specified XPCOM interface-member. """ isAttr = (member.kind == 'attribute') isMethod = (member.kind == 'method') assert isAttr or isMethod isGetter = isAttr and ...
print(cmd)
print(subprocess.list2cmdline(cmd))
def run_test(test, lib_dir): if test.tmflags: env = os.environ.copy() env['TMFLAGS'] = test.tmflags else: env = None cmd = get_test_cmd(test.path, lib_dir) if (test.valgrind and any([os.path.exists(os.path.join(d, 'valgrind')) for d in os.environ['PATH'].split(os.pathsep)])): valgrind_prefix = [ 'valgrind', '-q', '--s...
options = {} if sys.platform != 'win32': options["close_fds"] = True options["preexec_fn"] = set_limits p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, **options)
close_fds = sys.platform != 'win32' p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=close_fds, preexec_fn=set_limits)
def th_run_cmd(cmd, l): t0 = datetime.datetime.now() # close_fds and preexec_fn are not supported on Windows and will # cause a ValueError. options = {} if sys.platform != 'win32': options["close_fds"] = True options["preexec_fn"] = set_limits p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, **options) l[0] = p o...
err_str = 'bad response to pull: %s!' % error_msg
err_str = 'error returned from pull: %s' % error_msg
def err(error_msg): err_str = 'bad response to pull: %s!' % error_msg print err_str self._sock = None raise FileError(err_str)
def read(to_recv, error_msg):
def uread(to_recv, error_msg): """ unbuffered read """
def read(to_recv, error_msg): data = self._sock.recv(to_recv) if not data: err(error_msg) return None return data
buffer = '' while not '\n' in buffer: data = read(1024, 'could not find metadata') if data == None: return buffer += data nl = buffer.find('\n') metadata = buffer[:nl] print 'metadata: %s' % metadata filedata = buffer[nl+1:] sep = metadata.rfind(',') if sep == -1: err('could not find file size') return None filename = ...
metadata, sep, buffer = read_until_char('\n', buffer, 'could not find metadata') if not metadata: return None if self.debug >= 3: print 'metadata: %s' % metadata filename, sep, filesizestr = metadata.partition(',') if sep == '': err('could not find file size in returned metadata') return None
def read(to_recv, error_msg): data = self._sock.recv(to_recv) if not data: err(error_msg) return None return data
err('invalid file size') return None
err('invalid file size in returned metadata') return None
def read(to_recv, error_msg): data = self._sock.recv(to_recv) if not data: err(error_msg) return None return data
while not '\n' in filedata: data = read(1024, 'could not find metadata') if data == None: return None filedata += data nl = filedata.find('\n') error_str = filedata[:nl] filedata = filedata[nl+1:] while filedata < len(prompt): data = read(1024, 'could not find metadata') if data == None: return None print 'error pullin...
error_str, sep, buffer = read_until_char('\n', buffer, 'could not find error message') if not error_str: return None read_exact(len(prompt), buffer, 'could not find prompt') print 'DeviceManager: error pulling file: %s' % error_str return None
def read(to_recv, error_msg): data = self._sock.recv(to_recv) if not data: err(error_msg) return None return data
while len(filedata) < total_to_recv: to_recv = min(total_to_recv - len(filedata), 1024) data = read(to_recv, 'could not get all file data') if data == None: return None filedata += data if filedata[-len(prompt):] != prompt: err('no prompt') return filedata return filedata[:-len(prompt)]
buffer = read_exact(total_to_recv, buffer, 'could not get all file data') if buffer == None: return None if buffer[-len(prompt):] != prompt: err('no prompt found after file data--DeviceManager may be out of sync with agent') return buffer return buffer[:-len(prompt)]
def read(to_recv, error_msg): data = self._sock.recv(to_recv) if not data: err(error_msg) return None return data
print 'remotePath is %s' % remotePath print 'localPath is %s' % localPath
def getDirectory(self, remoteDir, localDir): if (self.debug >= 2): print "getting files in '" + remoteDir + "'" filelist = self.listFiles(remoteDir) if (filelist == None): return None if (self.debug >= 3): print filelist if not os.path.exists(localDir): os.makedirs(localDir) for f in filelist: if f == '.' or f == '..'...
print 'bad file "%s"!' % remotePath
print 'isdir failed on file "%s"; continuing anyway...' % remotePath
def getDirectory(self, remoteDir, localDir): if (self.debug >= 2): print "getting files in '" + remoteDir + "'" filelist = self.listFiles(remoteDir) if (filelist == None): return None if (self.debug >= 3): print filelist if not os.path.exists(localDir): os.makedirs(localDir) for f in filelist: if f == '.' or f == '..'...
print 'aborted when getting directory'
print 'failed to get directory "%s"' % remotePath
def getDirectory(self, remoteDir, localDir): if (self.debug >= 2): print "getting files in '" + remoteDir + "'" filelist = self.listFiles(remoteDir) if (filelist == None): return None if (self.debug >= 3): print filelist if not os.path.exists(localDir): os.makedirs(localDir) for f in filelist: if f == '.' or f == '..'...
self.getFile(remotePath, localPath)
if self.getFile(remotePath, localPath) == None: print 'failed to get file "%s"; continuing anyway...' % remotePath
def getDirectory(self, remoteDir, localDir): if (self.debug >= 2): print "getting files in '" + remoteDir + "'" filelist = self.listFiles(remoteDir) if (filelist == None): return None if (self.debug >= 3): print filelist if not os.path.exists(localDir): os.makedirs(localDir) for f in filelist: if f == '.' or f == '..'...
if (self.debug > 3): print "updateApp using command: " + str(cmd)
def updateApp(self, appBundlePath, processName=None, destPath=None, ipAddr=None, port=30000): status = None cmd = 'updt ' if (processName == None): # Then we pass '' for processName cmd += "'' " + appBundlePath else: cmd += processName + ' ' + appBundlePath
msgstart = _messageStartName(self.protocol.decl.type) +' << 10'
msgstart = _messageStartName(self.protocol.decl.type) +' << 16'
def visitProtocol(self, p): self.file.addthing(Whitespace("""
self._devicemanager.removeDir(self.remoteProfileDir)
self._devicemanager.removeDir(self.remoteProfile)
def cleanup(self, profileDir): self._devicemanager.removeDir(self.remoteProfileDir) self._devicemanager.removeDir(self.remoteTestRoot) RefTest.cleanup(self, profileDir)
reftest.startWebServer(options)
def main(): dm = DeviceManager(None, None) automation = RemoteAutomation(dm) parser = RemoteOptions(automation) options, args = parser.parse_args() if (options.deviceIP == None): print "Error: you must provide a device IP to connect to via the --device option" sys.exit(1) dm = DeviceManager(options.deviceIP, options....
" if (cache) {\n" " JSObject* wrapper = cache->GetWrapper();\n" " if (wrapper &&\n" " IS_SLIM_WRAPPER_OBJECT(wrapper) &&\n" " xpc_GetGlobalForObject(wrapper) ==\n" " xpc_GetGlobalForObject(obj)) {\n" " *%s = OBJECT_TO_JSVAL(wrapper);\n" " return JS_TRUE;\n" " ...
" if (xpc_GetCachedSlimWrapper(cache, obj, %s)) {\n" " return JS_TRUE;\n"
def writeResultConv(f, type, jsvalPtr, jsvalRef): """ Emit code to convert the C++ variable `result` to a jsval. The emitted code contains a return statement; it returns JS_TRUE on success, JS_FALSE on error. """ # From NativeData2JS. typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = resu...
" if (cache) {\n" " JSObject* wrapper = cache->GetWrapper();\n" " if (wrapper &&\n" " IS_SLIM_WRAPPER_OBJECT(wrapper) &&\n" " xpc_GetGlobalForObject(wrapper) ==\n" " xpc_GetGlobalForObject(obj)) {\n" " vp.array[0] = OBJECT_TO_JSVAL(wrapper);\n" " return wrapper;...
" JSObject* wrapper =\n" " xpc_GetCachedSlimWrapper(cache, obj, &vp.array[0]);\n" " if (wrapper) {\n" " return wrapper;\n"
def writeTraceableResultConv(f, type): typeName = getBuiltinOrNativeTypeName(type) assert typeName is not '[jsval]' if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(te...
def onCxxStackVar(self): assert self.decl.type.isToplevel() return ExprVar('IsOnCxxStack')
def exitedCxxStackVar(self): assert self.decl.type.isToplevel() return ExprVar('ExitedCxxStack')
onstack = MethodDefn( MethodDecl(p.onCxxStackVar().name, ret=Type.BOOL, const=1)) onstack.addstmt(StmtReturn(ExprCall( ExprSelect(p.channelVar(), '.', p.onCxxStackVar().name)))) self.cls.addstmts([ onentered, onexited, onstack, Whitespace.NL ])
self.cls.addstmts([ onentered, onexited, Whitespace.NL ])
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...
tfirstvar = ExprVar('T__First')
# - typedef to hack around placement delete limitations
typeenum.addId(tfirstvar.name, firstid)
def maybeReconstruct(memb, newTypeVar): ifdied = StmtIf(callMaybeDestroy(newTypeVar)) ifdied.addifstmt(StmtExpr(memb.callCtor())) return ifdied
_abortIfFalse(ExprBinary(tfirstvar, '<=', mtypevar),
_abortIfFalse(ExprBinary(tnonevar, '<=', mtypevar),
def maybeReconstruct(memb, newTypeVar): ifdied = StmtIf(callMaybeDestroy(newTypeVar)) ifdied.addifstmt(StmtExpr(memb.callCtor())) return ifdied
if member.kind == 'method' and not member.implicit_jscontext:
if member.kind == 'method' and not member.implicit_jscontext and not isVariantType(member.realtype):
def addStubMember(memberId, member, traceable): mayTrace = False if member.kind == 'method' and not member.implicit_jscontext: # This code MUST match writeTraceableQuickStub haveCallee = memberNeedsCallee(member) # Traceable natives support up to MAX_TRACEABLE_NATIVE_ARGS # total arguments. We always have two prefix a...
return traceParamTypeMap.get(type, defaultParamTraceType)[0] def getTraceReturnType(type):
def getTraceParamType(type): assert type is not '[jsval]' type = getBuiltinOrNativeTypeName(type) return traceParamTypeMap.get(type, defaultParamTraceType)[0]
return traceReturnTypeMap.get(type, defaultReturnTraceType)[0] def getTraceInfoParamType(type):
def getTraceReturnType(type): assert type is not '[jsval]' type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultReturnTraceType)[0]
return traceParamTypeMap.get(type, defaultParamTraceType)[1] def getTraceInfoReturnType(type):
def getTraceInfoParamType(type): assert type is not '[jsval]' type = getBuiltinOrNativeTypeName(type) return traceParamTypeMap.get(type, defaultParamTraceType)[1]
return traceReturnTypeMap.get(type, defaultReturnTraceType)[1] def getTraceInfoDefaultReturn(type):
def getTraceInfoReturnType(type): assert type is not '[jsval]' type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultReturnTraceType)[1]
type = getBuiltinOrNativeTypeName(type)
def getTraceInfoDefaultReturn(type): assert type is not '[jsval]' type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultReturnTraceType)[2]
self.cls.addstmts([ shouldcontinue, Whitespace.NL ])
entered = MethodDefn( MethodDecl(p.enteredCxxStackVar().name, virtual=1)) exited = MethodDefn( MethodDecl(p.exitedCxxStackVar().name, virtual=1)) self.cls.addstmts([ shouldcontinue, entered, exited, Whitespace.NL ])
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
options.utilityPath = options.remoteTestRoot + "/bin"
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
if options.remoteWebServer == None and os.name != "nt": options.remoteWebServer = get_lan_ip() elif os.name == "nt": print "ERROR: you must specify a remoteWebServer ip address\n" return None
if options.remoteWebServer == None: if os.name != "nt": options.remoteWebServer = get_lan_ip() else: print "ERROR: you must specify a remoteWebServer ip address\n" return None
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
options.utilityPath = productRoot + "/bin"
if (options.utilityPath == None): options.utilityPath = productRoot + "/bin"
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
argVal = "(%d < argc ? argv[%d] : JSVAL_NULL)" % (i, i)
if typeName == "[jsval]": val = "JSVAL_VOID" else: val = "JSVAL_NULL" argVal = "(%d < argc ? argv[%d] : %s)" % (i, i, val)
def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared, nullBehavior, undefinedBehavior): # f - file to write to # i - int or None - Indicates the source jsval. If i is an int, the source # jsval is argv[i]; otherwise it is *vp. But if Python i >= C++ argc, # which can only happen if option...
typeName = getBuiltinOrNativeTypeName(type)
def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared, nullBehavior, undefinedBehavior): # f - file to write to # i - int or None - Indicates the source jsval. If i is an int, the source # jsval is argv[i]; otherwise it is *vp. But if Python i >= C++ argc, # which can only happen if option...
for md in self.messageDecls: for param in md.inParams: if ipdl.type.hasshmem(param.type): return True for ret in md.outParams: if ipdl.type.hasshmem(ret.type): return True return False
return _usesShmem(self) def subtreeUsesShmem(self): return _subtreeUsesShmem(self)
def usesShmem(self): for md in self.messageDecls: for param in md.inParams: if ipdl.type.hasshmem(param.type): return True for ret in md.outParams: if ipdl.type.hasshmem(ret.type): return True return False
if p.usesShmem():
if p.subtreeUsesShmem():
def implementManagerIface(self): p = self.protocol routedvar = ExprVar('aRouted') idvar = ExprVar('aId') shmemvar = ExprVar('aShmem') sizevar = ExprVar('aSize') typevar = ExprVar('type') listenertype = Type('ChannelListener', ptr=1)
f.write(" return xpc_qsXPCOMObjectToJsval(lccx, " "ToSupports(result), xpc_qsGetWrapperCache(result), " "&NS_GET_IID(%s), &interfaces[k_%s], %s);\n"
f.write(" nsWrapperCache* cache = xpc_qsGetWrapperCache(result);\n" " qsObjectHelper helper(ToSupports(result));\n" " helper.SetNode(result);\n" " helper.SetCanonical(ToCanonicalSupports(result));\n" " // After this point do not use 'result'!\n" " return xpc_qsXPCOMObjectToJsval(lccx, " "&helper, cach...
def writeResultConv(f, type, jsvalPtr, jsvalRef): """ Emit code to convert the C++ variable `result` to a jsval. The emitted code contains a return statement; it returns JS_TRUE on success, JS_FALSE on error. """ # From NativeData2JS. typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = resu...
f.write(" JSBool ok = xpc_qsXPCOMObjectToJsval(lccx, " "ToSupports(result), xpc_qsGetWrapperCache(result), " "&NS_GET_IID(%s), &interfaces[k_%s], &vp.array[0]);\n"
f.write(" nsWrapperCache* cache = xpc_qsGetWrapperCache(result);\n" " qsObjectHelper helper(ToSupports(result));\n" " helper.SetNode(result);\n" " helper.SetCanonical(ToCanonicalSupports(result));\n" " // After this point do not use 'result'!\n" " JSBool ok = xpc_qsXPCOMObjectToJsval(lccx, " "&helper,...
def writeTraceableResultConv(f, type): typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(template, values)) return # else fa...
" if (!${name})\n" " return JS_FALSE;\n")
" if (!${name}) {\n" " xpc_qsThrowBadArgWithCcx(ccx, NS_ERROR_XPC_BAD_CONVERT_JS, %d);\n" " return JS_FALSE;\n" " }") % i
def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared, nullBehavior, undefinedBehavior): # f - file to write to # i - int or None - Indicates the source jsval. If i is an int, the source # jsval is argv[i]; otherwise it is *vp. But if Python i >= C++ argc, # which can only happen if option...
milliseconds = [int(val) for val in stdout.split(',')]
milliseconds = [float(val) for val in stdout.split(',')]
def bench(shellpath, filepath, warmup_runs, counted_runs, stfu=False): """Return a list of milliseconds for the counted runs.""" assert '"' not in filepath code = JS_CODE_TEMPLATE.substitute(filepath=filepath, warmup_run_count=warmup_runs, real_run_count=counted_runs) proc = subp.Popen([shellpath, '-e', code], stdout=s...
fmt = ' %30s: {"average_ms": %4d, "stddev_ms": %6.2f}'
fmt = ' %30s: {"average_ms": %6.2f, "stddev_ms": %6.2f}'
def parsemark(filepaths, fbench, stfu=False): """:param fbench: fbench(filename) -> float""" bench_map = {} for filepath in filepaths: filename = os.path.split(filepath)[-1] if not stfu: print 'Parsemarking %s...' % filename bench_map[filename] = fbench(filepath) print '{' for i, (filename, (avg, stddev)) in enumerate(...
result = 'FASTER: worst time %.2f < baseline best time %.2f' % (t_worst, base_t_best)
speedup = -((t_worst - base_t_best) / base_t_best) * 100 result = 'faster: %6.2fms < baseline %6.2fms (%+6.2f%%)' % \ (t_worst, base_t_best, speedup)
def compare(current, baseline): for key, (avg, stddev) in current.iteritems(): try: base_avg, base_stddev = itemgetter('average_ms', 'stddev_ms')(baseline.get(key, None)) except TypeError: print key, 'missing from baseline' continue t_best, t_worst = avg - stddev, avg + stddev base_t_best, base_t_worst = base_avg - bas...
result = 'SLOWER: best time %.2f > baseline worst time %.2f' % (t_best, base_t_worst)
slowdown = -((t_best - base_t_worst) / base_t_worst) * 100 result = 'SLOWER: %6.2fms > baseline %6.2fms (%+6.2f%%) ' % \ (t_best, base_t_worst, slowdown)
def compare(current, baseline): for key, (avg, stddev) in current.iteritems(): try: base_avg, base_stddev = itemgetter('average_ms', 'stddev_ms')(baseline.get(key, None)) except TypeError: print key, 'missing from baseline' continue t_best, t_worst = avg - stddev, avg + stddev base_t_best, base_t_worst = base_avg - bas...
parser.error('dirpath required')
parser.print_help() print print >> sys.stderr, 'error: dirpath required' return -1
def main(): parser = optparse.OptionParser(usage=__doc__.strip()) parser.add_option('-w', '--warmup-runs', metavar='COUNT', type=int, default=5, help='used to minimize test instability') parser.add_option('-c', '--counted-runs', metavar='COUNT', type=int, default=20, help='timed data runs that count towards the average...
nullfd = open(os.devnull, 'w') subprocess.call([stackwalkPath, d, symbolsPath], stderr=nullfd) nullfd.close()
p = subprocess.Popen([stackwalkPath, d, symbolsPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() if len(out) > 3: print out else: print "stderr from minidump_stackwalk:" print err if p.returncode != 0: print "minidump_stackwalk exited with return code %d" % p.returncode
def checkForCrashes(dumpDir, symbolsPath, testName=None): stackwalkPath = os.environ.get('MINIDUMP_STACKWALK', None) stackwalkCGI = os.environ.get('MINIDUMP_STACKWALK_CGI', None) # try to get the caller's filename if no test name is given if testName is None: try: testName = os.path.basename(sys._getframe(1).f_code.co_...
print urllib2.urlopen(request).read()
result = urllib2.urlopen(request).read() if len(result) > 3: print result else: print "stackwalkCGI returned nothing."
def checkForCrashes(dumpDir, symbolsPath, testName=None): stackwalkPath = os.environ.get('MINIDUMP_STACKWALK', None) stackwalkCGI = os.environ.get('MINIDUMP_STACKWALK_CGI', None) # try to get the caller's filename if no test name is given if testName is None: try: testName = os.path.basename(sys._getframe(1).f_code.co_...
reftest.runTests(args[0], options)
reftest.runTests(manifest, options)
def main(): dm = DeviceManager(None, None) automation = RemoteAutomation(dm) parser = RemoteOptions(automation) options, args = parser.parse_args() if (options.deviceIP == None): print "Error: you must provide a device IP to connect to via the --device option" sys.exit(1) dm = DeviceManager(options.deviceIP, options....
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = []
def readManifest(self): """ For a given manifest file, read the contents and populate self.testdirs """ manifestdir = os.path.dirname(self.manifest)
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = [] try: f = open(manifest, "r") for line in f: dir = line.rstrip() path = os.path.join(manifestdi...
f = open(manifest, "r")
f = open(self.manifest, "r")
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = [] try: f = open(manifest, "r") for line in f: dir = line.rstrip() path = os.path.join(manifestdi...
dir = line.rstrip() path = os.path.join(manifestdir, dir)
path = os.path.join(manifestdir, line.rstrip())
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = [] try: f = open(manifest, "r") for line in f: dir = line.rstrip() path = os.path.join(manifestdi...
testdirs.append(path)
self.testdirs.append(path)
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = [] try: f = open(manifest, "r") for line in f: dir = line.rstrip() path = os.path.join(manifestdi...
return testdirs
def buildTestList(self): """ Builds a dict of {"testdir" : ["testfile1", "testfile2", ...], "testdir2"...}. If manifest is given override testdirs to build initial list of directories and tests. If testpath is given, use that, otherwise chunk if requested. The resulting set of tests end up in self.alltests """ self.bui...
def readManifest(self, manifest): """ Given a manifest file containing a list of test directories, return a list of absolute paths to the directories contained within. """ manifestdir = os.path.dirname(manifest) testdirs = [] try: f = open(manifest, "r") for line in f: dir = line.rstrip() path = os.path.join(manifestdi...
if self.testPath:
if self.testPath is not None:
def buildTestPath(self): """ If we specifiy a testpath, set the self.testPath variable to be the given directory or file.
testfiles = sorted(glob(os.path.join(testdir, "test_*.js")))
testfiles = sorted(glob(os.path.join(os.path.abspath(testdir), "test_*.js")))
def getTestFiles(self, testdir): """ Ff a single test file was specified, we only want to execute that test, otherwise return a list of all tests in a directory
testfiles = [os.path.join(testdir, self.singleFile)]
testfiles = os.path.abspath([os.path.join(testdir, self.singleFile)])
def getTestFiles(self, testdir): """ Ff a single test file was specified, we only want to execute that test, otherwise return a list of all tests in a directory
debuggerInfo=None):
thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False):
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
self.debuggerInfo = debuggerInfo
self.totalChunks = totalChunks self.thisChunk = thisChunk self.debuggerInfo = getDebuggerInfo(self.oldcwd, debugger, debuggerArgs, debuggerInteractive)
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
if manifest is not None: testdirs = self.readManifest(os.path.abspath(manifest)) self.buildTestPath() for testdir in testdirs: self.buildXpcsCmd(testdir)
self.buildTestList() for testdir in sorted(self.alltests.keys()):
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
testdir = os.path.abspath(testdir)
self.buildXpcsCmd(testdir)
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
testfiles = self.getTestFiles(testdir) if testfiles == None: continue
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
for test in testfiles:
for test in self.alltests[testdir]:
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
replaceBackSlashes(os.path.join(testdir, test))]
replaceBackSlashes(test)]
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests.
debuggerInfo = getDebuggerInfo(xpcsh.oldcwd, options.debugger, options.debuggerArgs, options.debuggerInteractive);
def main(): parser = XPCShellOptions() options, args = parser.parse_args() if len(args) < 2 and options.manifest is None or \ (len(args) < 1 and options.manifest is not None): print >>sys.stderr, """Usage: %s <path to xpcshell> <test dirs> or: %s --manifest=test.manifest <path to xpcshell>""" % (sys.argv[0], sys.argv[...
if not xpcsh.runTests(args[0], xrePath=options.xrePath, symbolsPath=options.symbolsPath, manifest=options.manifest, testdirs=args[1:], testPath=options.testPath, interactive=options.interactive, logfiles=options.logfiles, debuggerInfo=debuggerInfo):
if not xpcsh.runTests(args[0], **options.__dict__):
def main(): parser = XPCShellOptions() options, args = parser.parse_args() if len(args) < 2 and options.manifest is None or \ (len(args) < 1 and options.manifest is not None): print >>sys.stderr, """Usage: %s <path to xpcshell> <test dirs> or: %s --manifest=test.manifest <path to xpcshell>""" % (sys.argv[0], sys.argv[...
virtual=1))
virtual=1)), Whitespace.NL
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
self.cls.addstmt(Whitespace.NL)
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
if flag not in ('-j', '-m'):
if flag not in ('-j', '-m', '-d'):
def parse_jitflags(): jitflags = [ [ '-' + flag for flag in flags ] for flags in OPTIONS.jitflags.split(',') ] for flags in jitflags: for flag in flags: if flag not in ('-j', '-m'): print('Invalid jit flag: "%s"'%flag) sys.exit(1) return jitflags
(TestResult.CRASH, False, False): ('TEST-UNEXPECTED-FAIL', 'REGRESSIONS'), (TestResult.CRASH, False, True): ('TEST-UNEXPECTED-FAIL', 'REGRESSIONS'), (TestResult.CRASH, True, False): ('TEST-UNEXPECTED-FAIL', 'REGRESSIONS'), (TestResult.CRASH, True, True): ('TEST-UNEXPECTED-F...
(TestResult.CRASH, False, False): ('TEST-UNEXPECTED-CRASH', 'REGRESSIONS'), (TestResult.CRASH, False, True): ('TEST-UNEXPECTED-CRASH', 'REGRESSIONS'), (TestResult.CRASH, True, False): ('TEST-UNEXPECTED-CRASH', 'REGRESSIONS'), (TestResult.CRASH, True, True): ('TEST-UNEXPECTE...
def push(self, output): if isinstance(output, NullTestOutput): if OPTIONS.tinderbox: print '%s | %s (SKIP)' % ('TEST-KNOWN-FAIL', output.test.path) self.counts[2] += 1 self.n += 1 else: if OPTIONS.show_cmd: print >> self.output_file, output.cmd
if self.interactive or self.verbose:
if self.interactive:
def getPipes(self): """ Determine the value of the stdout and stderr for the test. Return value is a list (pStdout, pStderr). """ if self.interactive or self.verbose: pStdout = None pStderr = None else: if (self.debuggerInfo and self.debuggerInfo["interactive"]): pStdout = None pStderr = None else: if sys.platform == '...
interactive=False, verbose=False, logfiles=True,
interactive=False, verbose=False, keepGoing=False, logfiles=True,
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, verbose=False, logfiles=True, thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False, profileName=None): """Run xpcshell tests.
if gotSIGINT: print "TEST-UNEXPECTED-FAIL | Received SIGINT (control-C) during test execution" if (keepGoing): gotSIGINT = False else: break
def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, verbose=False, logfiles=True, thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False, profileName=None): """Run xpcshell tests.
self.cls.addstmts([ shouldcontinue,
self.cls.addstmts([ processingerror, shouldcontinue,
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
self.cls.addstmts([ shouldcontinue, entered, exited,
enteredcall = MethodDefn( MethodDecl(p.enteredCallVar().name, virtual=1)) exitedcall = MethodDefn( MethodDecl(p.exitedCallVar().name, virtual=1)) self.cls.addstmts([ shouldcontinue, entered, exited, enteredcall, exitedcall,
for typedef in self.includedActorTypedefs: self.cls.addstmt(typedef)
self.cls.addstmts([ onentered, onexited, onstack, Whitespace.NL ])
self.cls.addstmts([ onentered, onexited, onenteredcall, onexitedcall, onstack, Whitespace.NL ])
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...
pb = ProgressBar('read input', n)
pb = ProgressBar(maxval=n, widgets=['read-input: ']+default_widgets)
def parse_cooked(filename): f = open(filename) header = f.read(20) if header != 'TraceVis-History0001': print "Invalid header" sys.exit(1) duration = struct.unpack_from('Q', f.read(8))[0] summary = [] state_count = struct.unpack_from('I', f.read(4))[0] for i in range(state_count): summary.append(struct.unpack_from('Q'...
pb = ProgressBar('draw main', W*H)
pb = ProgressBar(maxval=W*H, widgets=['draw main: ']+default_widgets)
def draw(data, outfile): total, summary, ts = data.duration, data.summary, data.transitions W, H, HA, HB = 1600, 256, 64, 64 HZ = H + 4 + HA + 4 + HB im = Image.new('RGBA', (W, HZ + 20)) d = ImageDraw.Draw(im) # Filter if 0: a, b = 10*2.2e9, 12*2.2e9 ts = [(s, t-a) for s, t in ts if a <= t <= b ] total_ms = total / C...
if self.logfiles and stdout:
if True and stdout:
def print_stdout(stdout): """Print stdout line-by-line to avoid overflowing buffers.""" print ">>>>>>>" for line in stdout.splitlines(): print line print "<<<<<<<"
" xpc_GetGlobalForObject(wrapper) ==\n" " xpc_GetGlobalForObject(obj)) {\n"
" cx->compartment == wrapper->compartment()) {\n"
def writeResultConv(f, type, jsvalPtr, jsvalRef): """ Emit code to convert the C++ variable `result` to a jsval. The emitted code contains a return statement; it returns JS_TRUE on success, JS_FALSE on error. """ # From NativeData2JS. typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = resu...
" xpc_GetGlobalForObject(wrapper) ==\n" " xpc_GetGlobalForObject(obj)) {\n"
" cx->compartment == wrapper->compartment()) {\n"
def writeTraceableResultConv(f, type): typeName = getBuiltinOrNativeTypeName(type) assert typeName is not '[jsval]' if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(te...
if p.usesShmem(): self.cls.addstmts(self.makeShmemIface())
self.cls.addstmts(self.makeShmemIface())
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...
options.platform)
options.platform, options.branch)
def main(): error = False parser = OptionParser( usage="%prog [options]") parser.add_option("--mar-path", action="store", dest="marPath", help="[Required] Specify the absolute path where the MAR file is found.") parser.add_option("--application-ini-file", action="store", dest="applicationIniFile", help="[Required] Spec...
downloadBaseURL, product, platform):
downloadBaseURL, product, platform, branch):
def generateSnippet(abstDistDir, applicationIniFile, locale, downloadBaseURL, product, platform): # Let's extract information from application.ini c = ConfigParser() try: c.readfp(open(applicationIniFile)) except IOError, (stderror): sys.exit(stderror) buildid = c.get("App", "BuildID") appVersion = c.get("App", "Versio...
branchName = c.get("App", "SourceRepository").split('/')[-1]
branchName = branch or c.get("App", "SourceRepository").split('/')[-1]
def generateSnippet(abstDistDir, applicationIniFile, locale, downloadBaseURL, product, platform): # Let's extract information from application.ini c = ConfigParser() try: c.readfp(open(applicationIniFile)) except IOError, (stderror): sys.exit(stderror) buildid = c.get("App", "BuildID") appVersion = c.get("App", "Versio...
options.utilityPath = options.remoteTestRoot + "/bin" options.certPath = options.remoteTestRoot + "/certs" if options.remoteWebServer == None and os.name != "nt": options.remoteWebServer = automation.getLanIp() elif os.name == "nt": print "ERROR: you must specify a remoteWebServer ip address\n" return None
productRoot = options.remoteTestRoot + "/" + automation._product if (options.utilityPath == self._automation.DIST_BIN): options.utilityPath = productRoot + "/bin" if options.remoteWebServer == None: if os.name != "nt": options.remoteWebServer = automation.getLanIp() else: print "ERROR: you must specify a --remote-web...
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
options.remoteLogFile = automation._devicemanager.getDeviceRoot() + '/test.log'
options.remoteLogFile = options.remoteTestRoot + '/mochitest.log'
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
options.remoteLogFile = automation._devicemanager.getDeviceRoot() + '/' + options.remoteLogFile productRoot = options.remoteTestRoot + "/" + automation._product options.utilityPath = productRoot + "/bin"
options.remoteLogFile = options.remoteTestRoot + '/' + options.remoteLogFile
def verifyRemoteOptions(self, options, automation): options.remoteTestRoot = automation._devicemanager.getDeviceRoot()
def runExtensionRegistration(self, options, browserEnv): """ run once with -silent to let the extension manager do its thing and then exit the app We do this on every run because we need to work around bug 570027 """ self._automation.log.info("INFO | runtestsremote.py | Performing extension manager registration: start....
def runExtensionRegistration(self, options, browserEnv): """ run once with -silent to let the extension manager do its thing and then exit the app We do this on every run because we need to work around bug 570027 """ self._automation.log.info("INFO | runtestsremote.py | Performing extension manager registration: start....
" if (cache) {\n" " JSObject* wrapper = cache->GetWrapper();\n" " NS_ASSERTION(cx->compartment == obj->compartment(),\n" " \"wrong compartment in object or context!\");\n" " if (wrapper &&\n" " IS_SLIM_WRAPPER_OBJECT(wrapper) &&\n" " cx->compartment == wrapper->com...
" if (xpc_GetCachedSlimWrapper(cache, obj, %s)) {\n" " return JS_TRUE;\n"
def writeResultConv(f, type, jsvalPtr, jsvalRef): """ Emit code to convert the C++ variable `result` to a jsval. The emitted code contains a return statement; it returns JS_TRUE on success, JS_FALSE on error. """ # From NativeData2JS. typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = resu...
" if (cache) {\n" " JSObject* wrapper = cache->GetWrapper();\n" " NS_ASSERTION(cx->compartment == obj->compartment(),\n" " \"wrong compartment in object or context!\");\n" " if (wrapper &&\n" " IS_SLIM_WRAPPER_OBJECT(wrapper) &&\n" " cx->compartment == wrapper->com...
" JSObject* wrapper =\n" " xpc_GetCachedSlimWrapper(cache, obj, &vp.array[0]);\n" " if (wrapper) {\n" " return wrapper;\n"
def writeTraceableResultConv(f, type): typeName = getBuiltinOrNativeTypeName(type) assert typeName is not '[jsval]' if typeName is not None: template = traceableResultConvTemplates.get(typeName) if template is not None: values = { 'errorStr': getFailureString( getTraceInfoDefaultReturn(type), 2) } f.write(substitute(te...
if ptype.isToplevel() and self.side is 'parent': self.cls.addstmt(Label.PROTECTED) otherpidvar = ExprVar('OtherSidePID') otherpid = MethodDefn(MethodDecl( otherpidvar.name, params=[ ], ret=Type('base::ProcessId'), const=1)) otherpid.addstmts([ StmtReturn(ExprCall( ExprVar('base::GetProcId'), args=[ p.otherProcessVar(...
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = Ex...