rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
handle.close() | if path != '-': handle.close() | def parseCG(path, name): handle = open(path) inContig = False for line in handle: if line[0] == '>': if inContig: #inContig = False break elif line.find(name) > -1: inContig = True print line.strip() else: if inContig: print line.strip() handle.close() |
seqs[name] = '' | seqs[name] = cStringIO.StringIO() | def loadAssembly(path): handle = open(path) seqs = {} name = None for line in handle: line = line.strip() if not line: continue if line[0] == '>': name = line seqs[name] = '' elif name: seqs[name] += line handle.close() sizes = [len(x) for x in seqs.values()] sizes.sort() return sizes |
seqs[name] += line | seqs[name].write(line) | def loadAssembly(path): handle = open(path) seqs = {} name = None for line in handle: line = line.strip() if not line: continue if line[0] == '>': name = line seqs[name] = '' elif name: seqs[name] += line handle.close() sizes = [len(x) for x in seqs.values()] sizes.sort() return sizes |
stats['n75' ] = sizes[nContigs / 4] stats['n50' ] = sizes[nContigs / 2] stats['n25' ] = sizes[(3 * nContigs) / 4] | stats['q75' ] = sizes[nContigs / 4] stats['q50' ] = sizes[nContigs / 2] stats['q25' ] = sizes[(3 * nContigs) / 4] a, b, c = getN25_50_75(sizes) stats['N25' ] = a stats['N50' ] = b stats['N75' ] = c | def printAssemblyStats(sizes, name, handle): nContigs = len(sizes) stats = {} stats['name' ] = name stats['n75' ] = sizes[nContigs / 4] stats['n50' ] = sizes[nContigs / 2] stats['n25' ] = sizes[(3 * nContigs) / 4] stats['m0' ] = nContigs stats['m100' ] = countLargerThan(sizes, 100) stats['m200' ] = ... |
if len(vclist[0]) == 0: return | if len(vclist) == 0 or len(vclist[0]) == 0: return | def probe_videocard_ok(self, operid, data): vclist = self.rootobj.tm.results[operid] if len(vclist[0]) == 0: return (vc0name, vc0driver, vc0vidram) = vclist[0] #self.set_data(self.rootobj.values, 'Xwindow.videocard.name', vc0name) #self.set_data(self.rootobj.values, 'Xwindow.videocard.driver', vc0driver) #self.set_dat... |
(N_('Install Package'), self.act_start_instpkg, self.act_end_instpkg), (N_('Make initrd'), self.act_start_mkinitrd, None), | def __init__(self, rootobj): self.rootobj = rootobj magicstep.magicstepgroup.__init__(self, rootobj, 'takeactions.xml', ['notes', 'ensure'], 'step') self.actlist = [(N_('Partition/Format'), self.act_start_parted, self.act_end_parted), | |
params=[ Decl(Type('nsIFile', ptrptr=1), dumpvar.name) ], | params=[ Decl(Type('nsILocalFile', ptrptr=1), dumpvar.name) ], | 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... |
const=1)) | const=1, virtual=1)) | 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... |
getconst = deepcopy(get) getconst.decl.ret = f.constRefType() getconst.decl.const = 1 | getconstdecl = deepcopy(get.decl) getconstdecl.ret = f.constRefType() getconstdecl.const = 1 getconst = MethodDefn(getconstdecl) getconst.addstmt(StmtReturn(f.constRefExpr())) | def assignFromOther(oexpr): return ExprCall(assignvar, args=[ f.initExpr(oexpr) for f in sd.fields ]) |
%s" % make_cab_comman | %s | def make_cab_file(cabwiz_path, program_name, cab_final_name): make_cab_command = "\"%s\" %s %s.inf" % (cabwiz_path, CompressFlag, program_name) print "INFORMATION: Executing command to make %s CAB file (only works on BASH)" % program_name print " [%s]" % make_cab_command sys.stdout.flush() success = call([cabwiz_pa... |
***************************************************************************""" | ***************************************************************************""" % make_cab_command | def make_cab_file(cabwiz_path, program_name, cab_final_name): make_cab_command = "\"%s\" %s %s.inf" % (cabwiz_path, CompressFlag, program_name) print "INFORMATION: Executing command to make %s CAB file (only works on BASH)" % program_name print " [%s]" % make_cab_command sys.stdout.flush() success = call([cabwiz_pa... |
print >> sys.stderr, "Usage: %s [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] | print >> sys.stderr, "Usage: %s [-setupdll] [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] | def main(): args = sys.argv if len(args) < 4 or len(args) > 7: print >> sys.stderr, "Usage: %s [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % args[0] sy... |
walk_tree(source_dir, ignored_patterns) sys.stdout.flush() output_inf_file(program_name, app_name) sys.stdout.flush() make_cab_file(cabwiz_path, program_name, cab_final_name) purge_copied_files() | if MakeSetupDllCab: output_setup_dll_inf_file(source_dir, program_name, app_name) sys.stdout.flush() make_cab_file(cabwiz_path, program_name, cab_final_name) os.remove("%s/setup.dll" % source_dir) else: walk_tree(source_dir, ignored_patterns) sys.stdout.flush() output_inf_file(program_name, app_name) sys.stdout.flush()... | def main(): args = sys.argv if len(args) < 4 or len(args) > 7: print >> sys.stderr, "Usage: %s [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0] print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % args[0] sy... |
'PRPackedBool' | 'PRPackedBool', | # stddef types |
def __init__(self, path, slow, allow_oom, tmflags, error, valgrind): """ path path to test file slow True means the test is slow-running allow_oom True means OOM should not be considered a failure valgrind True means test should run under valgrind """ self.path = path self.slow = slow self.allow_oom... | def __init__(self, path): self.path = path self.jitflags = [] self.slow = False self.allow_oom = False self.valgrind = False self.tmflags = '' self.error = '' def copy(self): t = Test(self.path) t.jitflags = self.jitflags t.slow = self.slow t.allow_oom = self.allow_oom t.valgrind = self.valgrind t.tmflags = self.tmfl... | def __init__(self, path, slow, allow_oom, tmflags, error, valgrind): """ path path to test file slow True means the test is slow-running allow_oom True means OOM should not be considered a failure valgrind True means test should run under valgrind """ self.path = path self.slow = slow self.allow_oom... |
slow = allow_oom = valgrind = False error = tmflags = '' | test = cls(path) | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
tmflags = value | test.tmflags = value | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
error = value | test.error = value | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
slow = True | test.slow = True | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
allow_oom = True | test.allow_oom = True | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
valgrind = options.valgrind | test.valgrind = options.valgrind | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
return cls(path, slow, allow_oom, tmflags, error, valgrind or options.valgrind_all) | if options.valgrind_all: test.valgrind = True return test | def from_file(cls, path, options): slow = allow_oom = valgrind = False error = tmflags = '' |
def get_test_cmd(path, lib_dir): | def get_test_cmd(path, jitflags, lib_dir): | 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', '-j' ] return [ JS ] + jit_flags + [ '-e', expr, '-f', os.path.join(l... |
if OPTIONS.methodjit_only: jit_flags = [ '-m' ] else: jit_flags = [ '-m', '-j' ] return [ JS ] + jit_flags + [ '-e', expr, '-f', os.path.join(lib_dir, 'prolog.js'), | return [ JS ] + jitflags + [ '-e', expr, '-f', os.path.join(lib_dir, 'prolog.js'), | 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', '-j' ] return [ JS ] + jit_flags + [ '-e', expr, '-f', os.path.join(l... |
cmd = get_test_cmd(test.path, lib_dir) | cmd = get_test_cmd(test.path, test.jitflags, lib_dir) | 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... |
pb = ProgressBar('', len(tests), 13) | pb = ProgressBar('', len(tests), 16) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
failures.append(test.path) | failures.append(test) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
pb.label = '[%3d|%3d|%3d]'%(n - len(failures), len(failures), n) | pb.label = '[%4d|%4d|%4d]'%(n - len(failures), len(failures), n) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
out.write(os.path.relpath(test, test_dir) + '\n') | if test.path not in written: out.write(os.path.relpath(test.path, test_dir) + '\n') written.add(test.path) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
print(' ' + subprocess.list2cmdline(get_test_cmd(test, lib_dir))) | print(' ' + subprocess.list2cmdline(get_test_cmd(test.path, test.jitflags, lib_dir))) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
print(' ' + test) | print(' ' + ' '.join(test.jitflags + [ test.path ])) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
op.add_option('--methodjit-only', dest='methodjit_only', action='store_true', help='Run tests with only method compiler enabled, not tracing') | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... | |
if len(test_list) > 1: | if len(job_list) > 1: | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
for tc in test_list: | for tc in job_list: | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
tc = test_list[0] | tc = job_list[0] | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
ok = run_tests(test_list, test_dir, lib_dir) | ok = run_tests(job_list, test_dir, lib_dir) | def run_tests(tests, test_dir, lib_dir): pb = None if not OPTIONS.hide_progress and not OPTIONS.show_cmd: try: from progressbar import ProgressBar pb = ProgressBar('', len(tests), 13) except ImportError: pass failures = [] complete = False doing = 'before starting' try: for i, test in enumerate(tests): doing = 'on %s'... |
"cx, rv, JSVAL_TO_OBJECT(*tvr.addr()), id);\n") | "cx, rv, JSVAL_TO_OBJECT(*tvr.jsval_addr()), id);\n") | 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... |
signature += "%s(JSContext *cx, JSObject *obj, jsval id,%s jsval *vp)\n" | signature += "%s(JSContext *cx, JSObject *obj, jsid id,%s jsval *vp)\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 ... |
pthisval = 'tvr.addr()' | pthisval = 'tvr.jsval_addr()' | 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 ... |
thisval = '*tvr.addr()' | thisval = '*tvr.jsval_addr()' | f.write("#ifdef DEBUG\n") |
'void': ("jsval ", "JSVAL", "JSVAL_VOID"), | 'void': ("uint32 ", "UINT32", "0"), | f.write("#ifdef DEBUG\n") |
'jsval': ("jsval ", "JSVAL", "JSVAL_VOID") | '[astring]': ("JSString *", "STRING_OR_NULL", "nsnull"), '[domstring]': ("JSString *", "STRING_OR_NULL", "nsnull"), '[cstring]': ("JSString *", "STRING_OR_NULL", "nsnull"), 'string': ("JSString *", "STRING_OR_NULL", "nsnull"), 'wstring': ("JSString *", "STRING_OR_NULL", "nsnull") | f.write("#ifdef DEBUG\n") |
traceTypeMap = traceReturnTypeMap.copy() traceTypeMap.update({ '[astring]': ("JSString *", "STRING", "nsnull"), '[domstring]': ("JSString *", "STRING", "nsnull"), '[cstring]': ("JSString *", "STRING", "nsnull"), 'string': ("JSString *", "STRING", "nsnull"), 'wstring': ("JSString *"... | traceParamTypeMap = traceReturnTypeMap.copy() traceParamTypeMap.update({ 'void': ("uint32 ", "UINT32"), 'boolean': ("JSBool ", "BOOL"), 'short': ("int32 ", "INT32"), 'unsigned short': ("uint32 ", "UINT32"), 'long': ("int32 ", "INT32"), 'unsigned long': ("uint32 ", "UINT3... | f.write("#ifdef DEBUG\n") |
defaultTraceType = ("jsval ", "JSVAL", "JSVAL_VOID") def getTraceType(type): | defaultReturnTraceType = ("JSObject *", "OBJECT_OR_NULL", "nsnull") defaultParamTraceType = ("js::ValueArgType ", "VALUE") def getTraceParamType(type): assert type is not '[jsval]' | f.write("#ifdef DEBUG\n") |
return traceTypeMap.get(type, defaultTraceType)[0] | return traceParamTypeMap.get(type, defaultParamTraceType)[0] | def getTraceType(type): type = getBuiltinOrNativeTypeName(type) return traceTypeMap.get(type, defaultTraceType)[0] |
return traceReturnTypeMap.get(type, defaultTraceType)[0] def getTraceInfoType(type): | return traceReturnTypeMap.get(type, defaultReturnTraceType)[0] def getTraceInfoParamType(type): assert type is not '[jsval]' | def getTraceReturnType(type): type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultTraceType)[0] |
return traceTypeMap.get(type, defaultTraceType)[1] | return traceParamTypeMap.get(type, defaultParamTraceType)[1] | def getTraceInfoType(type): type = getBuiltinOrNativeTypeName(type) return traceTypeMap.get(type, defaultTraceType)[1] |
return traceReturnTypeMap.get(type, defaultTraceType)[1] | return traceReturnTypeMap.get(type, defaultReturnTraceType)[1] | def getTraceInfoReturnType(type): type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultTraceType)[1] |
return traceTypeMap.get(type, defaultTraceType)[2] | return traceReturnTypeMap.get(type, defaultReturnTraceType)[2] | def getTraceInfoDefaultReturn(type): type = getBuiltinOrNativeTypeName(type) return traceTypeMap.get(type, defaultTraceType)[2] |
"XPCVariant::newVariant(ccx, ${argVal})));\n" | "XPCVariant::newVariant(ccx, js::Jsvalify(js::ValueArgToConstRef(${argVal})))));\n" | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(sub... |
"cx, %s, &%s, &%sref.ptr, &vp.array[%d]);\n" | "cx, js::Jsvalify(js::ValueArgToConstRef(%s)), &%s, &%sref.ptr, &vp.array[%d]);\n" | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(sub... |
" return JSVAL_VOID;\n", | " return 0;\n", | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(sub... |
" jsval rval;\n" " if (!xpc_qsStringToJsval(cx, result, &rval)) {\n" | " JSString *rval;\n" " if (!xpc_qsStringToJsstring(cx, result, &rval)) {\n" | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(sub... |
" return rval;\n", '[jsval]': " return vp.array[0];\n" | " return rval;\n" | def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx, rvdeclared): argVal = "_arg%d" % i params = { 'name': name, 'argVal': argVal } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = traceableArgumentConversionTemplates.get(typeName) if template is not None: f.write(sub... |
f.write(" return vp.array[0];\n") | f.write(" return JSVAL_TO_OBJECT(vp.array[0]);\n") | 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... |
f.write(", %s_arg%d" % (getTraceType(param.realtype), i)) traceInfo["params"].append(getTraceInfoType(param.realtype)) | f.write(", %s_arg%d" % (getTraceParamType(param.realtype), i)) traceInfo["params"].append(getTraceInfoParamType(param.realtype)) | def writeTraceableQuickStub(f, customMethodCalls, member, stubName): assert member.traceable traceInfo = { 'type': getTraceInfoReturnType(member.realtype) + "_FAIL", 'params': ["CONTEXT", "THIS"] } haveCcx = memberNeedsCcx(member) customMethodCall = customMethodCalls.get(stubName, None) if customMethodCall is None:... |
print 'Runs:', milliseconds | print 'Runs:', [int(ms) for ms in milliseconds] | 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... |
assert not self.decl.type.isToplevel() | assert thisexpr is not None or not self.decl.type.isToplevel() | def managerVar(self, thisexpr=None): assert not self.decl.type.isToplevel() mvar = ExprVar('mManager') if thisexpr is not None: mvar = ExprSelect(thisexpr, '->', mvar.name) return mvar |
+ [ StmtExpr(ExprCall(_deallocMethod(md.decl.type.constructedType()), args=[actorvar])), StmtExpr(self.callRemoveActor(actorvar)), | + [ StmtExpr(self.callRemoveActor( actorvar, ipdltype=md.decl.type.constructedType())), | def failCtorIf(self, md, cond): actorvar = md.actorDecl().var() failif = StmtIf(cond) failif.addifstmts( self.unregisterActor(actorvar) + [ StmtExpr(ExprCall(_deallocMethod(md.decl.type.constructedType()), args=[actorvar])), StmtExpr(self.callRemoveActor(actorvar)), StmtReturn(ExprLiteral.NULL), ]) return [ failif ] |
StmtExpr(self.callRemoveActor(actorexpr)), | def dtorEpilogue(self, md, actorexpr): return (self.unregisterActor(actorexpr) + [ StmtExpr(self.callActorDestroy(actorexpr)), StmtExpr(self.callRemoveActor(actorexpr)), StmtExpr(self.callDeallocSubtree(md, actorexpr)), StmtExpr(self.callDeallocActor(md, actorexpr)) ]) | |
StmtExpr(self.callDeallocActor(md, actorexpr)) | StmtExpr(self.callRemoveActor( actorexpr, manager=self.protocol.managerVar(actorexpr))) | def dtorEpilogue(self, md, actorexpr): return (self.unregisterActor(actorexpr) + [ StmtExpr(self.callActorDestroy(actorexpr)), StmtExpr(self.callRemoveActor(actorexpr)), StmtExpr(self.callDeallocSubtree(md, actorexpr)), StmtExpr(self.callDeallocActor(md, actorexpr)) ]) |
def callRemoveActor(self, actorexpr): if not self.protocol.decl.type.isManaged(): | def callRemoveActor(self, actorexpr, manager=None, ipdltype=None): if ipdltype is None: ipdltype = self.protocol.decl.type if not ipdltype.isManaged(): | def callRemoveActor(self, actorexpr): if not self.protocol.decl.type.isManaged(): return Whitespace('// unmanaged protocol') |
return ExprCall( ExprSelect(self.protocol.managerVar(actorexpr), '->', self.protocol.removeManageeMethod().name), args=[ _protocolId(self.protocol.decl.type), actorexpr ]) | removefunc = self.protocol.removeManageeMethod() if manager is not None: removefunc = ExprSelect(manager, '->', removefunc.name) return ExprCall(removefunc, args=[ _protocolId(ipdltype), actorexpr ]) | def callRemoveActor(self, actorexpr): if not self.protocol.decl.type.isManaged(): return Whitespace('// unmanaged protocol') |
def callDeallocActor(self, md, actorexpr): actor = md.decl.type.constructedType() return ExprCall( ExprSelect(ExprCall(self.protocol.managerMethod(actorexpr)), '->', _deallocMethod(md.decl.type.constructedType()).name), args=[ actorexpr ]) | def callDeallocSubtree(self, md, actorexpr): return ExprCall(ExprSelect(actorexpr, '->', 'DeallocSubtree')) | |
close_fds = sys.platform != 'win32' p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=close_fds, preexec_fn=set_limits) | options = {} if sys.platform != 'win32': options["close_fds"] = True options["preexec_fn"] = set_limits p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, **options) | def th_run_cmd(cmd, l): t0 = datetime.datetime.now() # close_fds is not supported on Windows and will cause a ValueError. close_fds = sys.platform != 'win32' p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=close_fds, preexec_fn=set_limits) l[0] = p out, err = p.communicate() t1 = datetime.datetime.now() ... |
setterName = 'js_GetterOnlyPropertyStub' | setterName = 'xpc_qsGetterOnlyPropertyStub' | def writeAttrStubs(f, customMethodCalls, attr): cmc = customMethodCalls.get(attr.iface.name + "_" + header.methodNativeName(attr), None) custom = cmc and cmc.get('skipgen', False) getterName = (attr.iface.name + '_' + header.attributeNativeName(attr, True)) if not custom: writeQuickStub(f, customMethodCalls, attr, get... |
{'allowXULXBL': ['localhost', '<file>']}) | {'allowXULXBL': [('localhost', True), ('<file>', True)]}) | def createReftestProfile(self, options, profileDir): "Sets up a profile for reftest." |
onstack, Whitespace.NL ]) | onstack, processincoming, 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... |
print >> self.output_file, output.cmd | print >> self.output_file, subprocess.list2cmdline(output.cmd) | 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 |
print ' '.join(cmd) | print subprocess.list2cmdline(cmd) | def p(path): for arg in args: if path.find(arg) != -1: return True return False |
os.environ.pop('PYTHONHOME', None) call([sys.executable, 'virtualenv/virtualenv.py', destination]) | env = os.environ.copy() env.pop('PYTHONHOME', None) call([sys.executable, 'virtualenv/virtualenv.py', destination], env=env) | def main(args=None): """command line front-end function""" args = args or sys.argv[1:] # The data is kept in the same directory as the script source=os.path.abspath(os.path.dirname(__file__)) # directory to install to if not len(args): destination = source elif len(args) == 1: destination = os.path.abspath(args[0]) ... |
call([pip, 'install'] + PACKAGES) | call([pip, 'install'] + PACKAGES, env=env) | def main(args=None): """command line front-end function""" args = args or sys.argv[1:] # The data is kept in the same directory as the script source=os.path.abspath(os.path.dirname(__file__)) # directory to install to if not len(args): destination = source elif len(args) == 1: destination = os.path.abspath(args[0]) ... |
failif.addifstmt(StmtReturn(_Result.ValuError)) | failif.addifstmt(StmtReturn(_Result.ProcessingError)) | def invokeRecvHandler(self, md, implicit=1): failif = StmtIf(ExprNot( ExprCall(md.recvMethod(), args=md.makeCxxArgs(params=1, retsems='in', retcallsems='out', implicit=implicit)))) failif.addifstmt(StmtReturn(_Result.ValuError)) return [ failif ] |
pip = os.path.join(destination, 'bin', 'pip') | if sys.platform.startswith('win'): pip = os.path.join(destination, 'Scripts', 'pip.exe') else: pip = os.path.join(destination, 'bin', 'pip') | def main(args=None): """command line front-end function""" args = args or sys.argv[1:] # The data is kept in the same directory as the script source=os.path.abspath(os.path.dirname(__file__)) # directory to install to if not len(args): destination = source elif len(args) == 1: destination = os.path.abspath(args[0]) ... |
if len(member.params) <= 3: mayTrace = True | haveCallee = memberNeedsCallee(member) prefixArgCount = 3 if haveCallee else 2 mayTrace = (len(member.params) <= MAX_TRACEABLE_NATIVE_ARGS - prefixArgCount) | def addStubMember(memberId, member, traceable): mayTrace = False if member.kind == 'method': if len(member.params) <= 3: mayTrace = True for param in member.params: for attrname, value in vars(param).items(): if value is True: # Let the tracer call the regular fastnative method if there # are optional arguments. if at... |
haveCcx = isMethod and anyParamRequiresCcx(member) | haveCcx = memberNeedsCcx(member) | 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 ... |
haveCcx = (member.kind == 'method') and anyParamRequiresCcx(member) | haveCcx = memberNeedsCcx(member) | def writeTraceableQuickStub(f, customMethodCalls, member, stubName): assert member.traceable traceInfo = { 'type': getTraceInfoReturnType(member.realtype) + "_FAIL", 'params': ["CONTEXT", "THIS"] } haveCcx = (member.kind == 'method') and anyParamRequiresCcx(member) customMethodCall = customMethodCalls.get(stubName, ... |
if haveCcx or isInterfaceType(member.realtype): | if memberNeedsCallee(member): | def writeTraceableQuickStub(f, customMethodCalls, member, stubName): assert member.traceable traceInfo = { 'type': getTraceInfoReturnType(member.realtype) + "_FAIL", 'params': ["CONTEXT", "THIS"] } haveCcx = (member.kind == 'method') and anyParamRequiresCcx(member) customMethodCall = customMethodCalls.get(stubName, ... |
Typedef(Type('mozilla::ipc::SharedMemory'), 'SharedMemory') | Typedef(Type('mozilla::ipc::SharedMemory'), 'SharedMemory'), Typedef(Type('mozilla::ipc::Trigger'), 'Trigger') | def standardTypedefs(self): return [ Typedef(Type('IPC::Message'), 'Message'), Typedef(Type(self.protocol.channelName()), 'Channel'), Typedef(Type(self.protocol.fqListenerName()), 'ChannelListener'), Typedef(Type('base::ProcessHandle'), 'ProcessHandle'), Typedef(Type('mozilla::ipc::SharedMemory'), 'SharedMemory') ] |
[ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending '), Whitespace.NL, StmtDecl(Decl(Type.BOOL, sendok.name), init=ExprCall( ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), 'Send'), args=[ msgexpr ])) | ([ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending ') ] + self.transition(md, 'out', actor) + [ Whitespace.NL, StmtDecl(Decl(Type.BOOL, sendok.name), init=ExprCall( ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), 'Send'), args=[ msgexpr ])) | def sendAsync(self, md, msgexpr, actor=None): sendok = ExprVar('__sendok') return ( sendok, [ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending '), Whitespace.NL, StmtDecl(Decl(Type.BOOL, sendok.name), init=ExprCall( ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), 'Send'), args=[ msgexpr ])) ... |
[ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending '), Whitespace.NL, StmtDecl( Decl(Type.BOOL, sendok.name), init=ExprCall(ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), _sendPrefix(md.decl.type)), args=[ msgexpr, ExprAddrOf(replyexpr) ])) | ([ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending ') ] + self.transition(md, 'out', actor) + [ Whitespace.NL, StmtDecl( Decl(Type.BOOL, sendok.name), init=ExprCall(ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), _sendPrefix(md.decl.type)), args=[ msgexpr, ExprAddrOf(replyexpr) ])) | def sendBlocking(self, md, msgexpr, replyexpr, actor=None): sendok = ExprVar('__sendok') return ( sendok, [ Whitespace.NL, self.logMessage(md, msgexpr, 'Sending '), Whitespace.NL, StmtDecl( Decl(Type.BOOL, sendok.name), init=ExprCall(ExprSelect(self.protocol.channelVar(actor), self.protocol.channelSel(), _sendPrefix(md... |
info = addressToSymbol(file, address) | try: info = addressToSymbol(file, address) if info.startswith("atos cannot"): sys.stderr.write("fix_macosx_stack will not convert some stack-trace addresses because: " + info + "\n") return line except IOError: return line | def fixSymbols(line): result = line_re.match(line) if result is not None: # before allows preservation of balance trees # after allows preservation of counts (before, file, address, after) = result.groups() address = int(address, 16) if os.path.exists(file) and os.path.isfile(file): address += address_adjustment(file)... |
if self.interactive: | if self.interactive or self.verbose: | def getPipes(self): """ Determine the value of the stdout and stderr for the test. Return value is a list (pStdout, pStderr). """ if self.interactive: pStdout = None pStderr = None else: if (self.debuggerInfo and self.debuggerInfo["interactive"]): pStdout = None pStderr = None else: if sys.platform == 'os2emx': pStdout... |
interactive=False, logfiles=True, | interactive=False, verbose=False, logfiles=True, | def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False, profileName=None): """Run xpcshell tests. |
signal.signal(signal.SIGINT, signal.SIG_IGN) | def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False, profileName=None): """Run xpcshell tests. | |
signal.signal(signal.SIGINT, signal.SIG_DFL) | def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, thisChunk=1, totalChunks=1, debugger=None, debuggerArgs=None, debuggerInteractive=False, profileName=None): """Run xpcshell tests. | |
_error(locFromTok(p, 1), 'missing message direction') if 2 == len(p): msg = p[1] msg.sendSemantics = ASYNC else: msg = p[2] msg.sendSemantics = p[1] | _error(msg.loc, 'missing message direction') | def p_MessageDecl(p): """MessageDecl : OptionalSendSemanticsQual MessageBody""" if Parser.current.direction is None: _error(locFromTok(p, 1), 'missing message direction') if 2 == len(p): msg = p[1] msg.sendSemantics = ASYNC else: msg = p[2] msg.sendSemantics = p[1] msg.direction = Parser.current.direction p[0] = msg |
msg = MessageDecl(locFromTok(p, 1)) msg.name = p[1] | loc, name = p[1] msg = MessageDecl(loc) msg.name = name | def p_MessageBody(p): """MessageBody : MessageId MessageInParams MessageOutParams""" # FIXME/cjones: need better loc info: use one of the quals msg = MessageDecl(locFromTok(p, 1)) msg.name = p[1] msg.addInParams(p[2]) msg.addOutParams(p[3]) p[0] = msg |
_error(locFromTok(p, 1), "sorry, `%s()' destructor syntax is a relic from a bygone era. Declare `__delete__()' in the `%s' protocol instead", p[1]+p[2], p[2]) | _error(loc, "sorry, `%s()' destructor syntax is a relic from a bygone era. Declare `__delete__()' in the `%s' protocol instead", p[1]+p[2], p[2]) | def p_MessageId(p): """MessageId : ID | __DELETE__ | DELETE | '~' ID""" if 3 == len(p): _error(locFromTok(p, 1), "sorry, `%s()' destructor syntax is a relic from a bygone era. Declare `__delete__()' in the `%s' protocol instead", p[1]+p[2], p[2]) elif 'delete' == p[1]: _error(locFromTok(p, 1), "`delete' is a reserved ... |
_error(locFromTok(p, 1), "`delete' is a reserved identifier") p[0] = p[1] | _error(loc, "`delete' is a reserved identifier") p[0] = [ loc, p[1] ] | def p_MessageId(p): """MessageId : ID | __DELETE__ | DELETE | '~' ID""" if 3 == len(p): _error(locFromTok(p, 1), "sorry, `%s()' destructor syntax is a relic from a bygone era. Declare `__delete__()' in the `%s' protocol instead", p[1]+p[2], p[2]) elif 'delete' == p[1]: _error(locFromTok(p, 1), "`delete' is a reserved ... |
'-f', os.path.join(self.testharnessdir, 'head.js')] | '-e', 'const _HEAD_JS_PATH = "%s";' % self.headJSPath, '-f', os.path.join(self.testharnessdir, 'head.js')] | def buildXpcsCmd(self, testdir): """ Load the root head.js file as the first file in our test path, before other head, test, and tail files. On a remote system, we overload this to add additional command line arguments, so this gets overloaded. """ self.xpcsCmd = [self.xpcshell, '-g', self.xrePath, '-j', '-s'] + \ ['-e... |
sys.stdout.write('Exit code: ' + str(p.returncode) + "\n") | sys.stdout.write('Exit code: %s\n' % code) | def run_test(test, lib_dir): env = os.environ.copy() if test.tmflags: env['TMFLAGS'] = test.tmflags cmd = get_test_cmd(test.path, test.jitflags, 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', '--smc... |
self.mkDirs(destname) | if self.mkDirs(destname) == None: print "unable to make dirs: " + destname return None | def pushFile(self, localname, destname): if (self.debug >= 2): print "in push file with: " + localname + ", and: " + destname if (self.validateFile(destname, localname) == True): if (self.debug >= 2): print "files are validated" return '' |
return self.sendCMD(['mkdr ' + name, 'quit']) | return self.sendCMD(['mkdr ' + name]) | def mkDir(self, name): return self.sendCMD(['mkdr ' + name, 'quit']) |
return '' | def mkDirs(self, filename): parts = filename.split('/') name = "" for part in parts: if (part == parts[-1]): break if (part != ""): name += '/' + part if (self.mkDir(name) == None): return None | |
self.sendCMD(['cd /tests', 'unzp ' + filename]) | dir = '' parts = filename.split('/') if (len(parts) > 1): if self.fileExists(filename): dir = '/'.join(parts[:-1]) elif self.fileExists('/' + filename): dir = '/' + filename elif self.fileExists('/tests/' + filename): dir = '/tests/' + filename else: return None return self.sendCMD(['cd ' + dir, 'unzp ' + filename]) ... | def unpackFile(self, filename): self.sendCMD(['cd /tests', 'unzp ' + filename]) |
+ self.makeReply(md, errfnRecv) | + [ Whitespace.NL ] + self.makeReply(md, errfnRecv, routingId=idvar) | def genDtorRecvCase(self, md): lbl = CaseLabel(md.pqMsgId()) case = StmtBlock() |
+ self.setMessageFlags(md, msgvar, reply=0, actor=fromActor)) | + self.setMessageFlags(md, msgvar, reply=0, routingId=routingId)) | def makeMessage(self, md, errfn, fromActor=None): msgvar = self.msgvar stmts = [ StmtDecl(Decl(Type(md.pqMsgClass(), ptr=1), msgvar.name)), Whitespace.NL ] msgCtorArgs = [ ] |
def makeReply(self, md, errfn): | def makeReply(self, md, errfn, routingId=None): | def makeReply(self, md, errfn): # TODO special cases for async ctor/dtor replies if md.decl.type.isAsync(): return [ ] |
+ self.setMessageFlags(md, replyvar, reply=1) | + self.setMessageFlags(md, replyvar, reply=1, routingId=routingId) | def makeReply(self, md, errfn): # TODO special cases for async ctor/dtor replies if md.decl.type.isAsync(): return [ ] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.