rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
self.WriteGLES2ImplementationDeclaration(func, file) | file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
if func.GetInfo('result') == None: func.AddInfo('result', ['uint32']) | def InitFunction(self, func): """Overrriden from TypeHandler.""" func.AddCmdArg(Argument("result_shm_id", 'uint32')) func.AddCmdArg(Argument("result_shm_offset", 'uint32')) if func.GetInfo('result') == None: func.AddInfo('result', ['uint32']) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n") | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
def InitFunction(self, func): """Overrriden from TypeHandler.""" cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) func.AddCmdArg(Argument('bucket_id', 'uint32')) | def InitFunction(self, func): """Overrriden from TypeHandler.""" # remove all but the first cmd args. cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) # add on a bucket id. func.AddCmdArg(Argument('bucket_id', 'uint32')) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
code = """%(return_type)s %(func_name)s(%(args)s) { helper_->SetBucketSize(kResultBucketId, 0); helper_->%(func_name)s(%(id_name)s, kResultBucketId); std::string str; if (GetBucketAsString(kResultBucketId, &str)) { GLsizei max_size = std::min(static_cast<size_t>(%(bufsize_name)s) - 1, str.size()); if (%(length_name)s != NULL) { *%(length_name)s = max_size; } memcpy(%(dest_name)s, str.c_str(), max_size); %(dest_name)s[max_size] = '\\0'; } } """ args = func.GetOriginalArgs() file.Write(code % { 'return_type': func.return_type, 'func_name': func.original_name, 'args': func.MakeTypedOriginalArgString(""), 'id_name': args[0].name, 'bufsize_name': args[1].name, 'length_name': args[2].name, 'dest_name': args[3].name, }) | file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) { | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; SpecializedSetup<%(name)s, 0>(); %(expect_len_code)s EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)), SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1))); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId); ASSERT_TRUE(bucket != NULL); EXPECT_EQ(strlen(kInfo) + 1, bucket->size()); EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo, bucket->size())); } """ args = func.GetOriginalArgs() id_name = args[0].GetValidGLArg(0, 0) get_len_func = func.GetInfo('get_len_func') get_len_enum = func.GetInfo('get_len_enum') sub = { 'id_name': id_name, 'get_len_func': get_len_func, 'get_len_enum': get_len_enum, 'gl_args': '%s, strlen(kInfo) + 1, _, _' % args[0].GetValidGLArg(0, 0), 'args': '%s, kBucketId' % args[0].GetValidArg(0, 0), 'expect_len_code': '', } if get_len_func[0:2] == 'gl': sub['expect_len_code'] = ( " EXPECT_CALL(*gl_, %s(%s, %s, _))\n" " .WillOnce(SetArgumentPointee<2>(strlen(kInfo)));") % ( get_len_func[2:], id_name, get_len_enum) self.WriteValidUnitTest(func, file, valid_test, sub) invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs) { const uint32 kBucketId = 123; EXPECT_CALL(*gl_, %(gl_func_name)s(_, _, _, _)) .Times(0); %(name)s cmd; cmd.Init(kInvalidClientId, kBucketId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); } """ self.WriteValidUnitTest(func, file, invalid_test) | file.Write("// TODO(gman): %s\n\n" % func.name) def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name) | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); | args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) file.Write(" GLsizei* length = NULL;\n") file.Write(" if (size_shm_id != 0 || size_shm_offset != 0) {\n" " length = GetSharedMemoryAs<GLsizei*>(\n" " size_shm_id, size_shm_offset, sizeof(*length));\n" " if (!length) {\n" " return error::kOutOfBounds;\n" " }\n" " }\n") dest_arg = args[-1] bufsize_arg = args[-3] | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); file.Write( " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
" %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) | " %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); file.Write( " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 0 | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
pass def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass | if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
"""class for GLsizei and GLsizeiptr.""" | def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1 | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
if func.is_immediate: return 0 | def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1 | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
"""overridden from Argument.""" | """returns an invalid value and expected parse result by index.""" | def GetInvalidArg(self, offset, index): """overridden from Argument.""" return ("-1", "kNoError", "GL_INVALID_VALUE") | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n") | def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
"""Base class for EnumArgument, IntArgument and BoolArgument""" | """Base calss for EnumArgument, IntArgument and BoolArgument""" | def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n") | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0 | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_error) | return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_INVALID_ENUM") | def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_error) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): """Overridden from Argument.""" return 2 | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
self.is_immediate = False | def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_args = num_pointer_args self.can_auto_generate = num_pointer_args == 0 and return_type == "void" self.cmd_args = cmd_args self.init_args = init_args self.args_for_cmds = args_for_cmds self.type_handler.InitFunction(self) self.is_immediate = False | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
def AddInfo(self, name, value): """Adds an info.""" setattr(self.info, name, value) | def GetInfo(self, name): """Returns a value from the function info for this function.""" if hasattr(self.info, name): return getattr(self.info, name) return None | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
def ClearCmdArgs(self): """Clears the command args for this function.""" self.cmd_args = [] | def GetCmdArgs(self): """Gets the command args for this function.""" return self.cmd_args | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
self.is_immediate = True | def __init__(self, func): new_args = [] for arg in func.GetOriginalArgs(): new_arg = arg.GetImmediateVersion() if new_arg: new_args.append(new_arg) | 56cf771f243d94985cd4e18f5f61bf6bab39d12c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/56cf771f243d94985cd4e18f5f61bf6bab39d12c/build_gles2_cmd_buffer.py |
|
'<a href="/echo">back to referring page</a></div>' | '<a href="http://localhost:8888/echo">back to referring page</a></div>' | def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
print 'HTTPS server started on port %d...' % server.server_port | print 'HTTPS server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
print 'HTTP server started on port %d...' % server.server_port | print 'HTTP server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
listen_port = server.server_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
|
listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port | print 'FTP server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
startup_pipe.write(struct.pack('@H', listen_port)) | startup_pipe.write("READY") | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.') | option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.') | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | d810993748b6fcd877aacfbdc88cd1712f5f3329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d810993748b6fcd877aacfbdc88cd1712f5f3329/testserver.py |
file_path = os.path.join(output_dir, ARCHIVE_DIR) | prefixed_archive_dir = (options.archive_prefix or "") + ARCHIVE_DIR file_path = os.path.join(output_dir, prefixed_archive_dir) | def MakeStagingDirectories(output_dir): """Creates a staging path for installer archive. If directory exists already, deletes the existing directory. """ file_path = os.path.join(output_dir, ARCHIVE_DIR) if os.path.exists(file_path): shutil.rmtree(file_path) os.makedirs(file_path) temp_file_path = os.path.join(output_dir, TEMP_ARCHIVE_DIR) if os.path.exists(temp_file_path): shutil.rmtree(temp_file_path) os.makedirs(temp_file_path) return (file_path, temp_file_path) | 0aec17d368206b95f01b7f7b76dee6a981718add /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0aec17d368206b95f01b7f7b76dee6a981718add/create_installer_archive.py |
temp_file_path = os.path.join(output_dir, TEMP_ARCHIVE_DIR) | prefixed_temp_archive_dir = (options.archive_prefix or "") + TEMP_ARCHIVE_DIR temp_file_path = os.path.join(output_dir, prefixed_temp_archive_dir) | def MakeStagingDirectories(output_dir): """Creates a staging path for installer archive. If directory exists already, deletes the existing directory. """ file_path = os.path.join(output_dir, ARCHIVE_DIR) if os.path.exists(file_path): shutil.rmtree(file_path) os.makedirs(file_path) temp_file_path = os.path.join(output_dir, TEMP_ARCHIVE_DIR) if os.path.exists(temp_file_path): shutil.rmtree(temp_file_path) os.makedirs(temp_file_path) return (file_path, temp_file_path) | 0aec17d368206b95f01b7f7b76dee6a981718add /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0aec17d368206b95f01b7f7b76dee6a981718add/create_installer_archive.py |
self.files_to_remove = [] | self._files_to_remove = [] | def setUp(self): pyauto.PyUITest.setUp(self) # Record all entries in the download dir download_dir = self.GetDownloadDirectory().value() self._existing_downloads = [] if os.path.isdir(download_dir): self._existing_downloads += os.listdir(download_dir) self.files_to_remove = [] # Files to remove after browser shutdown | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
self.files_to_remove.append(os.path.join(download_dir, name)) | self._files_to_remove.append(os.path.join(download_dir, name)) | def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: self.files_to_remove.append(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(self) for item in self.files_to_remove: pyauto_utils.RemovePath(item) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
for item in self.files_to_remove: | for item in self._files_to_remove: | def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: self.files_to_remove.append(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(self) for item in self.files_to_remove: pyauto_utils.RemovePath(item) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | self._DeleteAfterShutdown(downloaded_pkg) | def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | self._DeleteAfterShutdown(downloaded_pkg) | def testRemoveDownload(self): """Verify that we can remove a download.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_path = os.path.join(test_dir, 'a_zip_file.zip') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_file.zip') os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
try: file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._CallFunctionWithNewTimeout(4 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) finally: os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) os.path.exists(file_path) and os.remove(file_path) | self._DeleteAfterShutdown(file_path) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._DeleteAfterShutdown(downloaded_pkg) self._CallFunctionWithNewTimeout(4 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) | def testBigZip(self): """Verify that we can download a 1GB file. | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
os.path.exists(filename) and os.remove(filename) | self._DeleteAfterShutdown(filename) | def testFileRenaming(self): """Test file renaming when downloading a already-existing filename.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = 'file://%s' % os.path.join(test_dir, 'a_zip_file.zip') download_dir = self.GetDownloadDirectory().value() | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
try: for filename in crazy_filenames: utf8_filename = filename.encode('utf-8') file_path = os.path.join(temp_dir, utf8_filename) _CreateFile(os.path.join(temp_dir, filename)) file_url = self.GetFileURLForPath(file_path) downloaded_file = os.path.join(download_dir, filename) os.path.exists(downloaded_file) and os.remove(downloaded_file) self.DownloadAndWaitForStart(file_url) self.WaitForAllDownloadsToComplete() downloads = self.GetDownloadsInfo().Downloads() self.assertEqual(len(downloads), len(crazy_filenames)) for filename in crazy_filenames: downloaded_file = os.path.join(download_dir, filename) self.assertTrue(os.path.exists(downloaded_file)) self.assertTrue( self._EqualFileContents(downloaded_file, os.path.join(temp_dir, filename))) os.path.exists(downloaded_file) and os.remove(downloaded_file) finally: shutil.rmtree(unicode(temp_dir)) | for filename in crazy_filenames: utf8_filename = filename.encode('utf-8') file_path = os.path.join(temp_dir, utf8_filename) _CreateFile(os.path.join(temp_dir, filename)) file_url = self.GetFileURLForPath(file_path) downloaded_file = os.path.join(download_dir, filename) os.path.exists(downloaded_file) and os.remove(downloaded_file) self.DownloadAndWaitForStart(file_url) self.WaitForAllDownloadsToComplete() downloads = self.GetDownloadsInfo().Downloads() self.assertEqual(len(downloads), len(crazy_filenames)) for filename in crazy_filenames: downloaded_file = os.path.join(download_dir, filename) self.assertTrue(os.path.exists(downloaded_file)) self.assertTrue( self._EqualFileContents(downloaded_file, os.path.join(temp_dir, filename))) os.path.exists(downloaded_file) and os.remove(downloaded_file) | def _CreateFile(name): """Create and fill the given file with some junk.""" fp = open(name, 'w') # name could be unicode print >>fp, 'This is a junk file named %s. ' % repr(name) * 100 fp.close() | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
try: file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) pause_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') if pause_dict['state'] == 'COMPLETE': logging.info('The download completed before pause. Stopping test.') return self.assertTrue(pause_dict['is_paused']) self.assertTrue(pause_dict['state'] == 'IN_PROGRESS') resume_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') self.assertFalse(resume_dict['is_paused']) self._CallFunctionWithNewTimeout(2 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) finally: os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) os.path.exists(file_path) and os.remove(file_path) | file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._DeleteAfterShutdown(downloaded_pkg) self._DeleteAfterShutdown(file_path) pause_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') if pause_dict['state'] == 'COMPLETE': logging.info('The download completed before pause. Stopping test.') return self.assertTrue(pause_dict['is_paused']) self.assertTrue(pause_dict['state'] == 'IN_PROGRESS') resume_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') self.assertFalse(resume_dict['is_paused']) self._CallFunctionWithNewTimeout(2 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) | def testPauseAndResume(self): """Verify that pause and resume work while downloading a file. | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
self.files_to_remove.append(file_path) | self._DeleteAfterShutdown(file_path) | def testCancelDownload(self): """Verify that we can cancel a download.""" # Create a big file (250 MB) on the fly, so that the download won't finish # before being cancelled. file_path = self._MakeFile(2**28) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self.PerformActionOnDownload(self._GetDownloadId(), 'cancel') self.files_to_remove.append(file_path) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | self._DeleteAfterShutdown(downloaded_pkg) | def testDownloadsPersistence(self): """Verify that download history persists on session restart.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') file_url = self.GetFileURLForPath(os.path.join(test_dir, 'a_zip_file.zip')) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'a_zip_file.zip') os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) downloads = self.GetDownloadsInfo().Downloads() self.assertEqual(1, len(downloads)) self.assertEqual('a_zip_file.zip', downloads[0]['file_name']) file_url = downloads[0]['url'] self.RestartBrowser(clear_profile=False) # Trigger the download service to get loaded after restart. self.NavigateToURL('chrome://downloads/') # Verify that there's no download shelf anymore. self.assertFalse(self.IsDownloadShelfVisible(), 'Download shelf persisted browser restart.') # Verify that the download history persists. downloads = self.GetDownloadsInfo().Downloads() self.assertEqual(1, len(downloads)) self.assertEqual('a_zip_file.zip', downloads[0]['file_name']) self.assertEqual(file_url, downloads[0]['url']) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py |
server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | e98ed6c2044d751b05eace99e5a3cf191ecda36b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e98ed6c2044d751b05eace99e5a3cf191ecda36b/testserver.py |
|
ret += ["--show-possible=no"] | ret += ["--show-possibly-lost=no"] | def ToolSpecificFlags(self): ret = ["--leak-check=full", "--gen-suppressions=all", "--demangle=no"] | da2c1ee6a181402c83f3a9783e8c3a28bf613ab9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/da2c1ee6a181402c83f3a9783e8c3a28bf613ab9/valgrind_test.py |
url='http://localhost/?q=%s') | url=self._localhost_prefix + '?q=%s') | def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
self.assertEqual('http://localhost/?q=foobar', | self.assertEqual(self._localhost_prefix + '?q=foobar', | def testAddSearchEngine(self): """Test searching using keyword of user-added search engine.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://localhost/?q=%s') self.SetOmniboxText('foo.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
new_url='http://localhost/?bar=true&q=%s') | new_url=self._localhost_prefix + '?bar=true&q=%s') | def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineWithKeyword('bar.com')) self.assertFalse(self._GetSearchEngineWithKeyword('foo.com')) self.SetOmniboxText('bar.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?bar=true&q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
self.assertEqual('http://localhost/?bar=true&q=foobar', | self.assertEqual(self._localhost_prefix + '?bar=true&q=foobar', | def testEditSearchEngine(self): """Test editing a search engine's properties.""" self.AddSearchEngine(title='foo', keyword='foo.com', url='http://foo/?q=%s') self.EditSearchEngine(keyword='foo.com', new_title='bar', new_keyword='bar.com', new_url='http://localhost/?bar=true&q=%s') self.assertTrue(self._GetSearchEngineWithKeyword('bar.com')) self.assertFalse(self._GetSearchEngineWithKeyword('foo.com')) self.SetOmniboxText('bar.com foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?bar=true&q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
url='http://localhost/?q=%s') | url=self._localhost_prefix + '?q=%s') | def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.com') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertTrue(foo['is_default']) self.SetOmniboxText('foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
self.assertEqual('http://localhost/?q=foobar', | self.assertEqual(self._localhost_prefix + '?q=foobar', | def testMakeSearchEngineDefault(self): """Test adding then making a search engine default.""" self.AddSearchEngine( title='foo', keyword='foo.com', url='http://localhost/?q=%s') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertFalse(foo['is_default']) self.MakeSearchEngineDefault('foo.com') foo = self._GetSearchEngineWithKeyword('foo.com') self.assertTrue(foo) self.assertTrue(foo['is_default']) self.SetOmniboxText('foobar') self.OmniboxAcceptInput() self.assertEqual('http://localhost/?q=foobar', self.GetActiveTabURL().spec()) | 86d1d325053e5dfbb521e381887f0ba2cc498628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/86d1d325053e5dfbb521e381887f0ba2cc498628/search_engines.py |
self.WaitForInfobarCount(1) | self.assertTrue(self.WaitForInfobarCount(1), 'Did not get save password infobar') | def testDisplayAndSavePasswordInfobar(self): """Verify password infobar displays and able to save password.""" url_https = 'https://www.google.com/accounts/' url_logout = 'https://www.google.com/accounts/Logout' creds = self.GetPrivateInfo()['test_google_account'] username = creds['username'] password = creds['password'] test_utils.GoogleAccountsLogin(self, ['url'], username, password) # Wait until page completes loading. self.WaitUntil( lambda: self.GetDOMValue('document.readyState'), 'complete') self.WaitForInfobarCount(1) infobar = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'] self.assertEqual(infobar[0]['type'], 'confirm_infobar') self.PerformActionOnInfobar('accept', infobar_index=0) self.NavigateToURL(url_logout) self.NavigateToURL(url_https) test_utils.VerifyGoogleAccountCredsFilled(self, username, password) self.ExecuteJavascript('document.getElementById("gaia_loginform").submit();' 'window.domAutomationController.send("done")') test_utils.ClearPasswords(self) | e4b96a7f6b16054caf29140dd2f81df5b5326e09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e4b96a7f6b16054caf29140dd2f81df5b5326e09/passwords.py |
while (not found and (firstrun or ((time.time() - start) < 180.0))): | while (running and not found and (firstrun or ((time.time() - start) < 180.0))): | def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files. | d9df348482272abf9eeb4870bbaadd6e8bf81558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9df348482272abf9eeb4870bbaadd6e8bf81558/memcheck_analyze.py |
if not found: | if not running and not found: logging.warn("Valgrind process PID = %s is not running but " "its XML log has not been finished correctly." % pid) if running and not found: | def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files. | d9df348482272abf9eeb4870bbaadd6e8bf81558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9df348482272abf9eeb4870bbaadd6e8bf81558/memcheck_analyze.py |
'tools', 'layout_tests', 'layout_package', 'lighttpd.conf') | 'tools', 'layout_tests', 'webkitpy', 'layout_tests', 'layout_package', 'lighttpd.conf') | def Start(self): if self.IsRunning(): raise 'Lighttpd already running' | d584e8fca55fd66cbfbf74f84c1bff8760a4369c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d584e8fca55fd66cbfbf74f84c1bff8760a4369c/http_server.py |
os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS) | os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and os.path.basename(path) not in EXCLUDED_FILES) | def IsPEFile(path): return (os.path.isfile(path) and os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS) | 868525fcd5a697f484454c78cc4754e5fab77a5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/868525fcd5a697f484454c78cc4754e5fab77a5f/checkbins.py |
sys.exit(0) | sys.exit(1) | def main(options, args): directory = args[0] pe_total = 0 pe_passed = 0 for file in os.listdir(directory): path = os.path.abspath(os.path.join(directory, file)) if not IsPEFile(path): continue pe = pefile.PE(path, fast_load=True) pe_total = pe_total + 1 success = True # Check for /DYNAMICBASE. if pe.OPTIONAL_HEADER.DllCharacteristics & DYNAMICBASE_FLAG: if options.verbose: print "Checking %s for /DYNAMICBASE... PASS" % path else: success = False print "Checking %s for /DYNAMICBASE... FAIL" % path # Check for /NXCOMPAT. if pe.OPTIONAL_HEADER.DllCharacteristics & NXCOMPAT_FLAG: if options.verbose: print "Checking %s for /NXCOMPAT... PASS" % path else: success = False print "Checking %s for /NXCOMPAT... FAIL" % path # Update tally. if success: pe_passed = pe_passed + 1 print "Result: %d files found, %d files passed" % (pe_total, pe_passed) if pe_passed != pe_total: # TODO(scherkus): change this back to 1 once I've fixed failing builds. sys.exit(0) | 868525fcd5a697f484454c78cc4754e5fab77a5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/868525fcd5a697f484454c78cc4754e5fab77a5f/checkbins.py |
'<a href="/echo">back to referring page</a></div>' | '<a href="http://localhost:8888/echo">back to referring page</a></div>' | def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
print 'HTTPS server started on port %d...' % server.server_port | print 'HTTPS server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
print 'HTTP server started on port %d...' % server.server_port | print 'HTTP server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
listen_port = server.server_port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
|
listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port | print 'FTP server started on port %d...' % port | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
startup_pipe.write(struct.pack('@H', listen_port)) | startup_pipe.write("READY") | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.') | option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.') | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | a7bc29120dcca64c5720dc638813d6637f390450 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7bc29120dcca64c5720dc638813d6637f390450/testserver.py |
env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) | if 'GTEST_TOTAL_SHARDS' in env: outer_shards = int(env['GTEST_TOTAL_SHARDS']) outer_index = int(env['GTEST_SHARD_INDEX']) env['GTEST_TOTAL_SHARDS'] = str(self._num_shards * outer_shards) env['GTEST_SHARD_INDEX'] = str((self._num_shards * outer_index) + self._shard) else: env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) | def launch(self): env = os.environ.copy() env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) | 52056675802fecba4700aa9bb96a896cb4a9bc37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/52056675802fecba4700aa9bb96a896cb4a9bc37/parallel_launcher.py |
self.assertEqual(1, self.GetBrowserWindowCount(), 'Extensions in failing group: %s' % extensions[curr_extension:group_end]) | self.assertTrue(self.GetBrowserWindowCount(), 'Extensions in failing group: %s' % extensions[curr_extension:group_end]) | def testExtensionCrashes(self): """Add top extensions; confirm browser stays up when visiting top urls""" self.assertTrue(os.path.exists(self.extensions_dir_), 'The dir "%s" must exist' % os.path.abspath(self.extensions_dir_)) self.assertTrue(os.path.exists(self.urls_file_), 'The file "%s" must exist' % os.path.abspath(self.urls_file_)) | 22dc0b2652912b2471a5976edee8c12526284ce7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/22dc0b2652912b2471a5976edee8c12526284ce7/extensions.py |
if file_name.endswith(".html")) | if file_name.endswith(".html") and not file_name.startswith(".")) | def GetStaticFileNames(): static_files = os.listdir(_static_dir) return set(os.path.splitext(file_name)[0] for file_name in static_files if file_name.endswith(".html")) | 6f71a319072f5cb69e406efe6416c91e702a730f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6f71a319072f5cb69e406efe6416c91e702a730f/build.py |
ret[new_name] = (correct_semantic_case(semantic) if semantic else old_name_and_type.split(' ')[2]) | if semantic: ret[new_name] = correct_semantic_case(semantic) else: ret[new_name] = old_name_and_type.split(' ')[2] | def get_input_mapping(header): ret = dict() for l in header.splitlines(): if not l.startswith('//var'): continue old_name_and_type, semantic, new_name, _, _ = l.split(' : ') if '[' in new_name: new_name = new_name[:new_name.index('[')] if new_name.startswith('$'): new_name = new_name[1:] ret[new_name] = (correct_semantic_case(semantic) if semantic else old_name_and_type.split(' ')[2]) return ret | a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py |
header, body = re.split(os.linesep*2, glsl_shader, 1) assert all(l.startswith('//') for l in header.splitlines()) | if '\r\n' in glsl_shader: header, body = re.split('\r\n'*2, glsl_shader, 1) else: header, body = re.split(os.linesep*2, glsl_shader, 1) for l in header.splitlines(): assert l.startswith('//') | def fix_glsl(glsl_shader): header, body = re.split(os.linesep*2, glsl_shader, 1) assert all(l.startswith('//') for l in header.splitlines()) input_mapping = get_input_mapping(header) return header + '\n\n' + fix_glsl_body(body, input_mapping) | a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py |
f = sys.stdin if options.file is None else open(options.file) | if options.file is None: f = sys.stdin else: f = open(options.file) | def main(cg_shader): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment) | a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a19db7d6c77a3c1e43d75d04db58efc9d5e0cdff/convert.py |
If the 'replace_orig' and 'replace_new' URL query parameters are present, a new string is returned with all occasions of the 'replace_orig' value replaced by the 'replace_new' value. | If the 'replace_text' URL query parameter is present, it is expected to be of the form old_text:new_text, which indicates that any old_text strings in the file are replaced with new_text. Multiple 'replace_text' parameters may be specified. | def _ReplaceFileData(self, data, query_parameters): """Replaces matching substrings in a file. | e6ceef54171f7fd9f12b8ac239adac14fa708cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e6ceef54171f7fd9f12b8ac239adac14fa708cbd/testserver.py |
orig_values = query_dict.get('replace_orig', []) new_values = query_dict.get('replace_new', []) if not orig_values or not new_values: return data orig_value = orig_values[0] new_value = new_values[0] return data.replace(orig_value, new_value) | replace_text_values = query_dict.get('replace_text', []) for replace_text_value in replace_text_values: replace_text_args = replace_text_value.split(':') if len(replace_text_args) != 2: raise ValueError( 'replace_text must be of form old_text:new_text. Actual value: %s' % replace_text_value) old_text_b64, new_text_b64 = replace_text_args old_text = base64.urlsafe_b64decode(old_text_b64) new_text = base64.urlsafe_b64decode(new_text_b64) data = data.replace(old_text, new_text) return data | def _ReplaceFileData(self, data, query_parameters): """Replaces matching substrings in a file. | e6ceef54171f7fd9f12b8ac239adac14fa708cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e6ceef54171f7fd9f12b8ac239adac14fa708cbd/testserver.py |
stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]*\s*(\S*)') | stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]*\s*([^\n]*)') | def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports. | 5687473bc603f0a62ad6ed162b400dc4b8880194 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5687473bc603f0a62ad6ed162b400dc4b8880194/heapcheck_test.py |
return 'out' | return '../out' | def PlatformBuildPrefix(self): """Return a platform specific build directory prefix. | 4c74d9174de4df13ec25263555fcc64dceb896b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c74d9174de4df13ec25263555fcc64dceb896b8/coverage_posix.py |
asynchat.async_chat.__init__(self, sock) | asynchat.async_chat.__init__(self) asyncore.dispatcher.__init__(self, sock, socket_map) | def __init__(self, sock, socket_map, connections, addr): """Starts up the xmpp connection. | 4e0792b27048d90ea0dc1f0b98a8b1d1e1656faa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4e0792b27048d90ea0dc1f0b98a8b1d1e1656faa/xmppserver.py |
class ForkingHTTPServer(SocketServer.ForkingMixIn, StoppableHTTPServer): """This is a specialization of of StoppableHTTPServer which serves each request in a separate process""" pass class ForkingHTTPSServer(SocketServer.ForkingMixIn, HTTPSServer): """This is a specialization of of HTTPSServer which serves each request in a separate process""" pass | def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False | 6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py |
|
if options.forking: server_class = ForkingHTTPSServer else: server_class = HTTPSServer server = server_class(('127.0.0.1', port), TestPageHandler, options.cert) | server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert) | def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified cert file not found: ' + options.cert + ' exiting...' return if options.forking: server_class = ForkingHTTPSServer else: server_class = HTTPSServer server = server_class(('127.0.0.1', port), TestPageHandler, options.cert) print 'HTTPS server started on port %d...' % port else: if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url MakeDumpDir(server.data_dir) # means FTP Server else: my_data_dir = MakeDataDir() def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer pyftpdlib.ftpserver.logline = line_logger # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py |
if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler) | server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) | def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified cert file not found: ' + options.cert + ' exiting...' return if options.forking: server_class = ForkingHTTPSServer else: server_class = HTTPSServer server = server_class(('127.0.0.1', port), TestPageHandler, options.cert) print 'HTTPS server started on port %d...' % port else: if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url MakeDumpDir(server.data_dir) # means FTP Server else: my_data_dir = MakeDataDir() def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer pyftpdlib.ftpserver.logline = line_logger # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py |
option_parser.add_option('--forking', action='store_true', default=False, dest='forking', help='Serve each request in a separate process.') | def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) | 6c95057f238b96c6d89e366c5eb21ed532a92d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c95057f238b96c6d89e366c5eb21ed532a92d02/testserver.py |
|
num_invalid_values = arg.GetNumInvalidValues() | num_invalid_values = arg.GetNumInvalidValues(func) | def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" gl_error = None count = 0 for arg in func.GetOriginalArgs(): if count == arg_index: (arg_string, parse_result, gl_error) = arg.GetInvalidArg( count, value_index) else: arg_string = arg.GetValidArg(count, 0) arg_strings.append(arg_string) count += 1 gl_arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): gl_arg_strings.append("_") count += 1 gl_func_name = func.GetGLTestFunctionName() gl_error_test = '' if not gl_error == None: gl_error_test = '\n EXPECT_EQ(%s, GetGLError());' % gl_error | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
"""Writes the GLES2 Implemention declaration.""" | """Writes the GLES2 Implemention.""" | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention declaration.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | self.WriteGLES2ImplementationDeclaration(func, file) | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention declaration.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n") | impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file) | code = """%(return_type)s %(func_name)s(%(args)s) { helper_->SetBucketSize(kResultBucketId, 0); helper_->%(func_name)s(%(id_name)s, kResultBucketId); std::string str; if (GetBucketAsString(kResultBucketId, &str)) { GLsizei max_size = std::min(static_cast<size_t>(%(bufsize_name)s) - 1, str.size()); if (%(length_name)s != NULL) { *%(length_name)s = max_size; } memcpy(%(dest_name)s, str.c_str(), max_size); %(dest_name)s[max_size] = '\\0'; } } """ args = func.GetOriginalArgs() file.Write(code % { 'return_type': func.return_type, 'func_name': func.original_name, 'args': func.MakeTypedOriginalArgString(""), 'id_name': args[0].name, 'bufsize_name': args[1].name, 'length_name': args[2].name, 'dest_name': args[3].name, }) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file) | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
file.Write("// TODO(gman): %s\n\n" % func.name) def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name) | valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; SpecializedSetup<%(name)s, 0>(); %(expect_len_code)s EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)), SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1))); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId); ASSERT_TRUE(bucket != NULL); EXPECT_EQ(strlen(kInfo) + 1, bucket->size()); EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo, bucket->size())); } """ args = func.GetOriginalArgs() id_name = args[0].GetValidGLArg(0, 0) get_len_func = func.GetInfo('get_len_func') get_len_enum = func.GetInfo('get_len_enum') sub = { 'id_name': id_name, 'get_len_func': get_len_func, 'get_len_enum': get_len_enum, 'gl_args': '%s, strlen(kInfo) + 1, _, _' % args[0].GetValidGLArg(0, 0), 'args': '%s, kBucketId' % args[0].GetValidArg(0, 0), 'expect_len_code': '', } if get_len_func[0:2] == 'gl': sub['expect_len_code'] = ( " EXPECT_CALL(*gl_, %s(%s, %s, _))\n" " .WillOnce(SetArgumentPointee<2>(strlen(kInfo)));") % ( get_len_func[2:], id_name, get_len_enum) self.WriteValidUnitTest(func, file, valid_test, sub) invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs) { const uint32 kBucketId = 123; EXPECT_CALL(*gl_, %(gl_func_name)s(_, _, _, _)) .Times(0); %(name)s cmd; cmd.Init(kInvalidClientId, kBucketId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); } """ self.WriteValidUnitTest(func, file, invalid_test) | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name) | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) file.Write(" GLsizei* length = NULL;\n") file.Write(" if (size_shm_id != 0 || size_shm_offset != 0) {\n" " length = GetSharedMemoryAs<GLsizei*>(\n" " size_shm_id, size_shm_offset, sizeof(*length));\n" " if (!length) {\n" " return error::kOutOfBounds;\n" " }\n" " }\n") dest_arg = args[-1] bufsize_arg = args[-3] | args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) file.Write(" GLsizei* length = NULL;\n") file.Write(" if (size_shm_id != 0 || size_shm_offset != 0) {\n" " length = GetSharedMemoryAs<GLsizei*>(\n" " size_shm_id, size_shm_offset, sizeof(*length));\n" " if (!length) {\n" " return error::kOutOfBounds;\n" " }\n" " }\n") dest_arg = args[-1] bufsize_arg = args[-3] file.Write( " %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
" %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) | " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_last_2_args: arg.WriteGetCode(file) self.WriteGetDataSizeCode(func, file) size_arg = args[-2] file.Write(" uint32 size_shm_id = c.%s_shm_id;\n" % size_arg.name) file.Write(" uint32 size_shm_offset = c.%s_shm_offset;\n" % size_arg.name) file.Write(" GLsizei* length = NULL;\n") file.Write(" if (size_shm_id != 0 || size_shm_offset != 0) {\n" " length = GetSharedMemoryAs<GLsizei*>(\n" " size_shm_id, size_shm_offset, sizeof(*length));\n" " if (!length) {\n" " return error::kOutOfBounds;\n" " }\n" " }\n") dest_arg = args[-1] bufsize_arg = args[-3] file.Write( " %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" return 0 | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | pass def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass | def WriteValidationCode(self, file): """Writes the validation code for an argument.""" if self.type == 'GLsizei' or self.type == 'GLsizeiptr': file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): """overridden from Argument.""" return 1 | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
"""returns an invalid value and expected parse result by index.""" | """overridden from Argument.""" | def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("-1", "kNoError", "GL_INVALID_VALUE") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
"""Base calss for EnumArgument, IntArgument and BoolArgument""" | """Base class for EnumArgument, IntArgument and BoolArgument""" | def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("-1", "kNoError", "GL_INVALID_VALUE") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0 | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_INVALID_ENUM") | return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_error) | def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", "GL_INVALID_ENUM") return ("---ERROR1---", "kNoError", "GL_INVALID_ENUM") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): """Overridden from Argument.""" return 2 | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py |
def _GetTestsFromName(name): | def _ImportTestsFromName(name): | def _GetTestsFromName(name): """Get a list of all test names from the given string. | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
map(self._GetTestsFromName, all_tests_modules)) | map(self._ImportTestsFromName, all_tests_modules)) | def _ListMissingTests(self): """Print tests missing from PYAUTO_TESTS.""" # Fetch tests from all test scripts all_test_files = filter(lambda x: x.endswith('.py'), os.listdir(self.TestsDir())) all_tests_modules = [os.path.splitext(x)[0] for x in all_test_files] all_tests = reduce(lambda x, y: x + y, map(self._GetTestsFromName, all_tests_modules)) # Fetch tests included by PYAUTO_TESTS pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) pyauto_tests = reduce(lambda x, y: x + y, map(self._GetTestsFromName, self._LoadTestNamesFrom(pyauto_tests_file))) for a_test in all_tests: if a_test not in pyauto_tests: print a_test | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
map(self._GetTestsFromName, self._LoadTestNamesFrom(pyauto_tests_file))) | map(self._ImportTestsFromName, self._ExpandTestNamesFrom(pyauto_tests_file, self._options.suite))) | def _ListMissingTests(self): """Print tests missing from PYAUTO_TESTS.""" # Fetch tests from all test scripts all_test_files = filter(lambda x: x.endswith('.py'), os.listdir(self.TestsDir())) all_tests_modules = [os.path.splitext(x)[0] for x in all_test_files] all_tests = reduce(lambda x, y: x + y, map(self._GetTestsFromName, all_tests_modules)) # Fetch tests included by PYAUTO_TESTS pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) pyauto_tests = reduce(lambda x, y: x + y, map(self._GetTestsFromName, self._LoadTestNamesFrom(pyauto_tests_file))) for a_test in all_tests: if a_test not in pyauto_tests: print a_test | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
def _LoadTests(self, args): """Returns a suite of tests loaded from the given args. | def _ExpandTestNames(self, args): """Returns a list of tests loaded from the given args. | def _LoadTests(self, args): """Returns a suite of tests loaded from the given args. | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.