rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
third_party_dirs = FindThirdPartyDirs() ScanThirdPartyDirs(third_party_dirs) | command = 'help' if len(sys.argv) > 1: command = sys.argv[1] if command == 'scan': if not ScanThirdPartyDirs(): sys.exit(1) elif command == 'credits': if not GenerateCredits(): sys.exit(1) else: print __doc__ sys.exit(1) | def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. if path in PRUNE_PATHS: dirs[:] = [] continue # Prune out directories we want to skip. # (Note that we loop over PRUNE_DIRS so we're not iterating over a # list that we're simultaneously mutating.) for skip in PRUNE_DIRS: if skip in dirs: dirs.remove(skip) if os.path.basename(path) == 'third_party': # Add all subdirectories that are not marked for skipping. for dir in dirs: dirpath = os.path.join(path, dir) if dirpath not in PRUNE_PATHS: third_party_dirs.append(dirpath) # Don't recurse into any subdirs from here. dirs[:] = [] continue return third_party_dirs | 8283b10cafab170f6dfd7f266163aefc223892fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8283b10cafab170f6dfd7f266163aefc223892fe/licenses.py |
func.AddCmdArg(Argument('data_size', 'uint32')) | func.AddCmdArg(DataSizeArgument('data_size')) | def InitFunction(self, func): """Add or adjust anything type specific for this function.""" if func.GetInfo('needs_size'): func.AddCmdArg(Argument('data_size', 'uint32')) | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
EXPECT_EQ(0, result->size);%(gl_error_test)s | EXPECT_EQ(0u, result->size);%(gl_error_test)s | typedef %(name)s::Result Result; | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
class GLcharHandler(TypeHandler): | class GLcharHandler(CustomHandler): | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" const int kSomeBaseValueToTestWith = 51;\n") file.Write(" static %s data[] = {\n" % func.info.data_type) for v in range(0, func.info.count * 2): file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" % (func.info.data_type, v)) file.Write(" };\n") file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") args = func.GetCmdArgs() value = 1 for arg in args: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n data);\n") args = func.GetCmdArgs() value = 1 file.Write(" EXPECT_EQ(static_cast<uint32>(%s::kCmdId),\n" % func.name) file.Write(" cmd.header.command);\n") file.Write(" EXPECT_EQ(sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)),\n") file.Write(" cmd.header.size * 4u);\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n") for arg in args: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): Check that data was inserted;\n") file.Write("}\n") file.Write("\n") | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
TypeHandler.__init__(self) def InitFunction(self, func): """Overrriden from TypeHandler.""" func.AddCmdArg(Argument('data_size', 'uint32')) def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" 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 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) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs()[:-1] for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write(" const char* name = GetSharedMemoryAs<%s>(\n" % last_arg.type) file.Write(" c.%s_shm_id, c.%s_shm_offset, name_size);\n" % (last_arg.name, last_arg.name)) func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(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) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs()[:-1] for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write( " const char* name = GetImmediateDataAs<const char*>(\n") file.Write(" c, name_size, immediate_data_size);\n") func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" // TODO(gman): This needs to change to use SendString.\n") file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") | CustomHandler.__init__(self) | def __init__(self): TypeHandler.__init__(self) | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
class GetGLcharHandler(GLcharHandler): """Handler for glGetAttibLoc, glGetUniformLoc.""" def __init__(self): GLcharHandler.__init__(self) def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" 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 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) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs() for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write(" const char* name = GetSharedMemoryAs<%s>(\n" % last_arg.type) file.Write(" c.%s_shm_id, c.%s_shm_offset, name_size);\n" % (last_arg.name, last_arg.name)) file.Write(" GLint* location = GetSharedMemoryAs<GLint*>(\n") file.Write( " c.location_shm_id, c.location_shm_offset, sizeof(*location));\n") file.Write(" // TODO(gman): Validate location.\n") func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(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) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs()[:-1] for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write( " const char* name = GetImmediateDataAs<const char*>(\n") file.Write(" c, name_size, immediate_data_size);\n") file.Write(" GLint* location = GetSharedMemoryAs<GLint*>(\n") file.Write( " c.location_shm_id, c.location_shm_offset, sizeof(*location));\n") file.Write(" // TODO(gman): Validate location.\n") func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" // TODO(gman): This needs to change to use SendString.\n") file.Write(" GLint* result = shared_memory_.GetAddressAs<GLint*>(0);\n") file.Write(" DCHECK(false); // pass in shared memory\n") file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write(" int32 token = helper_->InsertToken();\n") file.Write(" helper_->WaitForToken(token);\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") def WriteImmediateCmdComputeSize(self, func, file): """Overrriden from TypeHandler.""" file.Write(" static uint32 ComputeDataSize(const char* s) {\n") file.Write(" return strlen(s);\n") file.Write(" }\n") file.Write("\n") file.Write(" static uint32 ComputeSize(const char* s) {\n") file.Write(" return static_cast<uint32>(\n") file.Write(" sizeof(ValueType) + ComputeDataSize(s)); // NOLINT\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdSetHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void SetHeader(const char* s) {\n") file.Write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(s));\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdInit(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void Init(%s) {\n" % func.MakeTypedInitString("_")) file.Write(" SetHeader(_name);\n") args = func.GetInitArgs() for arg in args: file.Write(" %s = _%s;\n" % (arg.name, arg.name)) file.Write(" data_size = ComputeDataSize(_name);\n") file.Write(" memcpy(ImmediateDataAddress(this), _name, data_size);\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdSet(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void* Set(void* cmd%s) {\n" % func.MakeTypedInitString("_", True)) file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % func.MakeInitString("_")) file.Write(" const uint32 size = ComputeSize(_name);\n") file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>(" "cmd, size);\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdHelper(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void %s(%s) {\n" % (func.name, func.MakeTypedCmdArgString(""))) file.Write(" const uint32 size = gles2::%s::ComputeSize(name);\n" % func.name) file.Write(" gles2::%s& c = GetImmediateCmdSpaceTotalSize<gles2::%s>(" "size);\n" % (func.name, func.name)) file.Write(" c.Init(%s);\n" % func.MakeCmdArgString("")) file.Write(" }\n\n") def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" static const char* const test_str = \"test string\";\n") file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n test_str);\n") value = 11 file.Write(" EXPECT_EQ(%s::kCmdId ^ cmd.header.command);\n" % func.name) file.Write(" EXPECT_EQ(sizeof(cmd)\n") file.Write(" RoundSizeToMultipleOfEntries(strlen(test_str)),\n") file.Write(" cmd.header.size * 4u);\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd));\n"); for arg in all_but_last_arg: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): check that string got copied.\n") file.Write("}\n") file.Write("\n") | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" init_code = [] check_code = [] all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: init_code.append(" static_cast<%s>(%d)," % (arg.type, value)) value += 1 value = 11 for arg in all_but_last_arg: check_code.append(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);" % (arg.type, value, arg.name)) value += 1 code = """ | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
|
self.type_handler.InitFunction(self) | 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 | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
|
'GetGLchar': GetGLcharHandler(), | def __init__(self, verbose): self.original_functions = [] self.functions = [] self.verbose = verbose self.errors = 0 self._function_info = {} self._empty_type_handler = TypeHandler() self._empty_function_info = FunctionInfo({}, self._empty_type_handler) | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
|
("OP(%s)" % func.name, _CMD_ID_TABLE[func.name])) | ("OP(%s)" % by_id[id].name, id)) | def WriteCommandIds(self, filename): """Writes the command buffer format""" file = CHeaderWriter(filename) file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") for func in self.functions: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) file.Write(" %-60s /* %d */ \\\n" % ("OP(%s)" % func.name, _CMD_ID_TABLE[func.name])) file.Write("\n") | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py |
if self._options.indirect: return self.GetAnalyzeResultsIndirect() | def Analyze(self, check_sanity=False): if self._options.indirect: return self.GetAnalyzeResultsIndirect() filenames = glob.glob(self.TMP_DIR + "/tsan.*") use_gdb = common.IsMac() analyzer = tsan_analyze.TsanAnalyze(self._source_dir, filenames, use_gdb=use_gdb) ret = analyzer.Report(check_sanity) if ret != 0: logging.info("Please see http://dev.chromium.org/developers/how-tos/" "using-valgrind/threadsanitizer for the info on " "ThreadSanitizer") return ret | d889d58ad749f0c07c6b9646986202071639fd5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d889d58ad749f0c07c6b9646986202071639fd5f/valgrind_test.py |
|
def AddBucketFunction(self, generator, func): """Adds a bucket version of a function.""" # Generate an immediate command if there is only 1 pointer arg. bucket = func.GetInfo('bucket') # can be True, False or None if bucket: generator.AddFunction(BucketFunction(func)) | 4393968a3cd68a637ea9c9ae73d23638606d2353 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4393968a3cd68a637ea9c9ae73d23638606d2353/build_gles2_cmd_buffer.py |
||
'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', | self.GetFileURLForPath('another_non-existing_path'), | def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), 'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', ] for url in urls: self.NavigateToURL(url) self.assertEqual(0, len(self.GetHistoryInfo().History())) | a0dd450b1e383dee3300d132cb2432232f00653e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a0dd450b1e383dee3300d132cb2432232f00653e/history.py |
self.NavigateToURL(url) | if not url.startswith('file://'): logging.warn('Using %s. Might depend on how dns failures are handled' 'on the network' % url) self.NavigateToURL(url) | def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), 'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', ] for url in urls: self.NavigateToURL(url) self.assertEqual(0, len(self.GetHistoryInfo().History())) | a0dd450b1e383dee3300d132cb2432232f00653e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a0dd450b1e383dee3300d132cb2432232f00653e/history.py |
server_data = { 'port': listen_port } server_data_json = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(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 = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(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") # First write the data length as an unsigned 4-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('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b83ea2a0a15a069524f1617d88f328c54529c14b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b83ea2a0a15a069524f1617d88f328c54529c14b/testserver.py |
|
startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) | startup_pipe.write(struct.pack('@H', listen_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, 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 = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(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") # First write the data length as an unsigned 4-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('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b83ea2a0a15a069524f1617d88f328c54529c14b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b83ea2a0a15a069524f1617d88f328c54529c14b/testserver.py |
"Cond", "Free", "Leak", "Overlap", "Param", | "Cond", "Free", "Jump", "Leak", "Overlap", "Param", | def ReadSuppressions(lines, supp_descriptor): """Given a list of lines, returns a list of suppressions. Args: lines: a list of lines containing suppressions. supp_descriptor: should typically be a filename. Used only when parsing errors happen. """ result = [] cur_descr = '' cur_type = '' cur_stack = [] in_suppression = False nline = 0 for line in lines: nline += 1 line = line.strip() if line.startswith('#'): continue if not in_suppression: if not line: # empty lines between suppressions pass elif line.startswith('{'): in_suppression = True pass else: raise SuppressionError(supp_descriptor, nline, 'Expected: "{"') elif line.startswith('}'): result.append(Suppression(cur_descr, cur_type, cur_stack)) cur_descr = '' cur_type = '' cur_stack = [] in_suppression = False elif not cur_descr: cur_descr = line continue elif not cur_type: if not line.startswith("Memcheck:"): raise SuppressionError(supp_descriptor, nline, '"Memcheck:TYPE" is expected, got "%s"' % line) if not line[9:] in ["Addr1", "Addr2", "Addr4", "Addr8", "Cond", "Free", "Leak", "Overlap", "Param", "Value1", "Value2", "Value4", "Value8"]: raise SuppressionError(supp_descriptor, nline, 'Unknown suppression type "%s"' % line[9:]) cur_type = line continue elif re.match("^fun:.*|^obj:.*|^\.\.\.$", line): cur_stack.append(line.strip()) elif len(cur_stack) == 0 and cur_type == "Memcheck:Param": cur_stack.append(line.strip()) else: raise SuppressionError(supp_descriptor, nline, '"fun:function_name" or "obj:object_file" ' \ 'or "..." expected') return result | 25c7877befa5e81a6ba7f8fceedccf9988d3ba96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/25c7877befa5e81a6ba7f8fceedccf9988d3ba96/suppressions.py |
(shortname, extension) = os.path.splitext(file_name) | (shortname, extension) = os.path.splitext(file_name.split("?")[0]) | def GetMIMETypeFromName(self, file_name): """Returns the mime type for the specified file_name. So far it only looks at the file extension.""" | d9befdf2078e156ccaa25643a15aad1325ac2e3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9befdf2078e156ccaa25643a15aad1325ac2e3a/testserver.py |
elif options.path: output.write(path, os.path.join(options.path, os.path.basename(path))) | def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input file does not exist:', path) if os.path.isdir(path): raise Exception('Input file is a path:', path) # Open the output file. if options.input: shutil.copyfile(options.input, options.output) mode = 'a' else: mode = 'w' output = zipfile.ZipFile(options.output, mode, zipfile.ZIP_DEFLATED) # Add the files to the output archive. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: if options.config != 'Debug': break elif options.path: output.write(path, os.path.join(options.path, os.path.basename(path))) else: output.write(path) output.close() return 0 | 2d0b55bbc66b3860ffac1a55854d4552da30e98b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2d0b55bbc66b3860ffac1a55854d4552da30e98b/zipfiles.py |
|
output.write(path) | dest_path = path if options.path: dest_path = os.path.join(options.path, os.path.basename(path)) extension = os.path.splitext(path)[1] if extension: extension = extension[1:] if extension in ignore_extensions: output.write(path, dest_path) else: contents = version.subst_file(path, subst_values) output.writestr(dest_path, contents) | def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input file does not exist:', path) if os.path.isdir(path): raise Exception('Input file is a path:', path) # Open the output file. if options.input: shutil.copyfile(options.input, options.output) mode = 'a' else: mode = 'w' output = zipfile.ZipFile(options.output, mode, zipfile.ZIP_DEFLATED) # Add the files to the output archive. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: if options.config != 'Debug': break elif options.path: output.write(path, os.path.join(options.path, os.path.basename(path))) else: output.write(path) output.close() return 0 | 2d0b55bbc66b3860ffac1a55854d4552da30e98b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2d0b55bbc66b3860ffac1a55854d4552da30e98b/zipfiles.py |
if results_json[self.VERSION_KEY] == 2: | if self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == 2: | def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return | af5dfbb14dd352e4bdb14f440fb14248ffedf377 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/af5dfbb14dd352e4bdb14f440fb14248ffedf377/json_results_generator.py |
if not IsLinux(): | if not common.IsLinux(): | def Create(self, tool_name): if tool_name == "memcheck": return Memcheck() if tool_name == "memcheck_wine": return Memcheck() if tool_name == "tsan": if not IsLinux(): logging.info("WARNING: ThreadSanitizer may be unstable on Mac.") logging.info("See http://code.google.com/p/data-race-test/wiki/" "ThreadSanitizerOnMacOsx for the details") return ThreadSanitizer() try: platform_name = common.PlatformName() except common.NotImplementedError: platform_name = sys.platform + "(Unknown)" raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, platform_name) | e44a685c4744f126f56e229be0513e3b35923fef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e44a685c4744f126f56e229be0513e3b35923fef/valgrind_test.py |
return source_paths | return sorted(source_paths) | def _parse_source_files(self): """ Returns a list of paths to source files present in the extenion. | 1ba20e8dfe884a6947b0174dfd3fde84c19f319b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ba20e8dfe884a6947b0174dfd3fde84c19f319b/directory.py |
_remove_expected_call_re = re.compile(r' EXPECT_CALL.*?;\n', re.S) | def Close(self): self.Write("#endif // %s\n\n" % self.guard) CWriter.Close(self) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
|
if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) | def WriteValidUnitTest(self, func, file, test, extra = {}): """Writes a valid unit test.""" if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) name = func.name arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): arg_strings.append(arg.GetValidArg(count, 0)) count += 1 gl_arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): gl_arg_strings.append(arg.GetValidGLArg(count, 0)) count += 1 gl_func_name = func.GetGLTestFunctionName() vars = { 'test_name': 'GLES2DecoderTest%d' % file.file_num, 'name':name, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'gl_args': ", ".join(gl_arg_strings), } vars.update(extra) file.Write(test % vars) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
|
num_invalid_values = arg.GetNumInvalidValues(func) | num_invalid_values = arg.GetNumInvalidValues() | 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(func) 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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
def WriteGLES2ImplementationDeclaration(self, func, file): | def WriteGLES2ImplementationHeader(self, func, file): | def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
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.""" | def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
|
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) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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']) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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')) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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) { | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 = """ | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
"""class for GLsizei and GLsizeiptr.""" | def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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") | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
def GetNumInvalidValues(self, func): | def GetNumInvalidValues(self): | def GetNumInvalidValues(self, func): """Overridden from Argument.""" return 2 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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 | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/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) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py |
|
BaseTool.__init__(self) | super(ValgrindTool, self).__init__() | def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
ValgrindTool.__init__(self) | super(Memcheck, self).__init__() | def __init__(self): ValgrindTool.__init__(self) self.RegisterOptionParserHook(Memcheck.ExtendOptionParser) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
def __init__(self): BaseTool.__init__(self) | def __init__(self): BaseTool.__init__(self) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
|
def __init__(self): ValgrindTool.__init__(self) ThreadSanitizerBase.__init__(self) | def __init__(self): ValgrindTool.__init__(self) ThreadSanitizerBase.__init__(self) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
|
PinTool.__init__(self) ThreadSanitizerBase.__init__(self) | super(ThreadSanitizerWindows, self).__init__() | def __init__(self): PinTool.__init__(self) ThreadSanitizerBase.__init__(self) self.RegisterOptionParserHook(ThreadSanitizerWindows.ExtendOptionParser) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
BaseTool.__init__(self) | super(DrMemory, self).__init__() | def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(DrMemory.ExtendOptionParser) | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
proc += ['--race-verifier=' + self.TMP_DIR + '/race.log'] | proc += ['--race-verifier=' + self.TMP_DIR + '/race.log', '--race-verifier-sleep-ms=%d' % int(self._options.race_verifier_sleep_ms)] | def ToolSpecificFlags(self): proc = super(ThreadSanitizerRV2Mixin, self).ToolSpecificFlags() proc += ['--race-verifier=' + self.TMP_DIR + '/race.log'] return proc | b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b2a6a37f3cf39160da0a6a1da57eb4cfc4967ae8/valgrind_test.py |
(error.__hash__() & 0xffffffffffffffff) | (error.__hash__() & 0xffffffffffffffff)) | def Report(self, files, check_sanity=False): '''Reads in a set of files and prints Memcheck report. | 2463803c4016439b49882fc7e3416de6a1bbac0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2463803c4016439b49882fc7e3416de6a1bbac0f/memcheck_analyze.py |
if self.attrs['use_name_for_id'] == 'true': | if (self.attrs['use_name_for_id'] == 'true' and self.SatisfiesOutputCondition()): | def EndParsing(self): super(type(self), self).EndParsing() | df2c3c3e306e513fd62fa1a1effb83985fe4ee5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/df2c3c3e306e513fd62fa1a1effb83985fe4ee5c/message.py |
'cygwin': 'win', | } platform_flags = { 'darwin': '-DSWIGMAC', 'linux2': '-DSWIGLINUX', 'win32': '-DSWIGWIN', | def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', 'cygwin': 'win', } swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig') os.execv(swig_bin, [swig_bin] + sys.argv[1:]) | 97212efe51af21d7381e25b0367bc28b4c216bab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/97212efe51af21d7381e25b0367bc28b4c216bab/swig.py |
os.execv(swig_bin, [swig_bin] + sys.argv[1:]) | args = [swig_bin, platform_flags[sys.platform]] + sys.argv[1:] args = [x.replace('/', os.sep) for x in args] print "Executing", args sys.exit(subprocess.call(args)) | def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', 'cygwin': 'win', } swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig') os.execv(swig_bin, [swig_bin] + sys.argv[1:]) | 97212efe51af21d7381e25b0367bc28b4c216bab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/97212efe51af21d7381e25b0367bc28b4c216bab/swig.py |
search_term = split_url.path partial_url = self._GetOmniboxMatchesFor(search_term, windex=windex) | partial_url = self._GetOmniboxMatchesFor(split_url.scheme, windex=windex) | def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete title would get the bookmark title_matches = self._GetOmniboxMatchesFor(title, windex=windex) self._VerifyHasBookmarkResult(title_matches) # Check if the partial URL would get the bookmark split_url = urlparse.urlsplit(url) search_term = split_url.path partial_url = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_url) # Check if the partial title would get the bookmark split_title = title.split() search_term = split_title[len(split_title) - 1] partial_title = self._GetOmniboxMatchesFor(search_term, windex=windex) self._VerifyHasBookmarkResult(partial_title) | 8a2772fbda73a1f82b7e24a89b2bda35439e0316 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8a2772fbda73a1f82b7e24a89b2bda35439e0316/omnibox.py |
logging.debug('Starting %s server.' % self._server_name) | logging.info('Starting %s server on %d.' % ( self._server_name, self._port)) logging.debug('cmdline: %s' % ' '.join(start_cmd)) | def Start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.IsRunning(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) | 22e6a57f6f220435f7d1610e05dc2768b0a4a495 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/22e6a57f6f220435f7d1610e05dc2768b0a4a495/websocket_server.py |
logging.debug('Shutting down %s server %d.' % (self._server_name, pid)) | logging.info('Shutting down %s server %d.' % (self._server_name, pid)) | def Stop(self, force=False): if not force and not self.IsRunning(): return | 22e6a57f6f220435f7d1610e05dc2768b0a4a495 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/22e6a57f6f220435f7d1610e05dc2768b0a4a495/websocket_server.py |
logging.info('Using handler_map_file: %s' % handler_map_file) | logging.debug('Using handler_map_file: %s' % handler_map_file) | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) | e4109d2ab6d5441cc5bde539241ef0af8c757c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e4109d2ab6d5441cc5bde539241ef0af8c757c58/websocket_server.py |
logging.info('Starting %s server on %d.' % ( | logging.debug('Starting %s server on %d.' % ( | def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name) | e4109d2ab6d5441cc5bde539241ef0af8c757c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e4109d2ab6d5441cc5bde539241ef0af8c757c58/websocket_server.py |
logging.info('Shutting down %s server %d.' % (self._server_name, pid)) | logging.debug('Shutting down %s server %d.' % (self._server_name, pid)) | def stop(self, force=False): if not force and not self.is_running(): return | e4109d2ab6d5441cc5bde539241ef0af8c757c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e4109d2ab6d5441cc5bde539241ef0af8c757c58/websocket_server.py |
'resource_type': func.name[3:-1].lower() | 'resource_type': func.name[3:-1].lower(), 'count_name': func.GetOriginalArgs()[0].name, | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { | 2fcb6ce152ade33030c30dba7deaf9e639ee2aff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2fcb6ce152ade33030c30dba7deaf9e639ee2aff/build_gles2_cmd_buffer.py |
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" %s_id_handler_->FreeIds(%s);\n" % (func.name[6:-1].lower(), func.MakeOriginalArgString(""))) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") | code = """%(return_type)s %(name)s(%(typed_args)s) { if (%(count_name)s < 0) { SetGLError(GL_INVALID_VALUE, "gl%(name)s: n < 0"); return; } %(resource_type)s_id_handler_->FreeIds(%(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % { 'return_type': func.return_type, 'name': func.original_name, 'typed_args': func.MakeTypedOriginalArgString(""), 'args': func.MakeOriginalArgString(""), 'resource_type': func.name[6:-1].lower(), 'count_name': func.GetOriginalArgs()[0].name, }) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" %s_id_handler_->FreeIds(%s);\n" % (func.name[6:-1].lower(), func.MakeOriginalArgString(""))) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") | 2fcb6ce152ade33030c30dba7deaf9e639ee2aff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2fcb6ce152ade33030c30dba7deaf9e639ee2aff/build_gles2_cmd_buffer.py |
GLsizei num_values = util_.GLGetNumValuesReturned(pname); if (num_values == 0) { SetGLError(GL_INVALID_ENUM, "gl%(func_name)s: invalid enum"); return error::kNoError; } | GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); | code = """ typedef %(func_name)s::Result Result; | 2fcb6ce152ade33030c30dba7deaf9e639ee2aff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2fcb6ce152ade33030c30dba7deaf9e639ee2aff/build_gles2_cmd_buffer.py |
gl_arg_strings.append("result->GetData()") | if func.GetInfo('gl_test_func') == 'glGetIntegerv': gl_arg_strings.append("_") else: gl_arg_strings.append("result->GetData()") | typedef %(name)s::Result Result; | 2fcb6ce152ade33030c30dba7deaf9e639ee2aff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2fcb6ce152ade33030c30dba7deaf9e639ee2aff/build_gles2_cmd_buffer.py |
(arg_string, parse_result) = arg.GetInvalidArg(count, value_index) | (arg_string, parse_result, gl_error) = arg.GetInvalidArg( count, value_index) | 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" count = 0 for arg in func.GetOriginalArgs(): if count == arg_index: (arg_string, parse_result) = 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() vars = { 'test_name': 'GLES2DecoderTest%d' % file.file_num , 'name': func.name, 'arg_index': arg_index, 'value_index': value_index, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'all_but_last_args': ", ".join(arg_strings[:-1]), 'gl_args': ", ".join(gl_arg_strings), 'parse_result': parse_result, } vars.update(extra) file.Write(test % vars) arg_index += 1 | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd)); | EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s | def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
ExecuteImmediateCmd(cmd, sizeof(temp))); | ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
ExecuteImmediateCmd(cmd, sizeof(temp))); | ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd)); | EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
return ("---ERROR0---", "---ERROR2---") | return ("---ERROR0---", "---ERROR2---", None) | def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("---ERROR0---", "---ERROR2---") | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
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 | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
return (invalid[index], "kNoError") return ("---ERROR1---", "kNoError") | 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") return ("---ERROR1---", "kNoError") | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") | return ("kInvalidSharedMemoryId, 0", "kOutOfBounds", None) | def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds") | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
"kOutOfBounds") | "kOutOfBounds", None) | def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds") | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py |
return os.path.join(sub_path, 'dangerous.dmg') | return os.path.join(sub_path, 'invalid-dummy.dmg') | def _GetDangerousDownload(self): """Returns the file url for a dangerous download for this OS.""" sub_path = os.path.join(self.DataDir(), 'downloads', 'dangerous') if self.IsMac(): return os.path.join(sub_path, 'dangerous.dmg') return os.path.join(sub_path, 'dangerous.exe') | 1ca57ffcd3fc85c8a1d62edc0c949e466a2c05a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ca57ffcd3fc85c8a1d62edc0c949e466a2c05a3/downloads.py |
for current_name in MATRIX_UNIFORM_NAMES: if lower_name == current_name.lower(): return current_name return lower_name | return MATRIX_UNIFORM_NAMES_MAPPING.get(lower_name, lower_name) | def correct_semantic_case(name): lower_name = name.lower() for current_name in MATRIX_UNIFORM_NAMES: if lower_name == current_name.lower(): return current_name return lower_name | ee1bd28ecfe38ff53511fe5f7beb1470629c7e22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee1bd28ecfe38ff53511fe5f7beb1470629c7e22/convert.py |
test_prefixes = ["FLAKY", "FAILS"] | test_prefixes = ["FLAKY", "FAILS", "MAYBE"] | def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ self._options.valgrind_tool)] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.join(directory, name + ".gtest-%s_%s.txt" % \ (self._options.valgrind_tool, platform_suffix))] for filename in gtest_filter_files: if os.path.exists(filename): logging.info("reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith("#") or line.startswith("//") or line.isspace(): continue line = line.rstrip() test_prefixes = ["FLAKY", "FAILS"] for p in test_prefixes: # Strip prefixes from the test names. line = line.replace(".%s_" % p, ".") # Exclude the original test name. filters.append(line) if line[-2:] != ".*": # List all possible prefixes if line doesn't end with ".*". for p in test_prefixes: filters.append(line.replace(".", ".%s_" % p)) # Get rid of duplicates. filters = set(filters) gtest_filter = self._gtest_filter if len(filters): if gtest_filter: gtest_filter += ":" if gtest_filter.find("-") < 0: gtest_filter += "-" else: gtest_filter = "-" gtest_filter += ":".join(filters) if gtest_filter: cmd.append("--gtest_filter=%s" % gtest_filter) | 0d935cec88688f0ac2431c921e454112578152d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0d935cec88688f0ac2431c921e454112578152d2/chrome_tests.py |
result = unittest.TextTestRunner(verbosity=verbosity).run(pyauto_suite) | result = PyAutoTextTestRuner(verbosity=verbosity).run(pyauto_suite) | def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid()) | 71b6d8c77b5e0d548c64bc7b0bfaa8c574ba3b44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/71b6d8c77b5e0d548c64bc7b0bfaa8c574ba3b44/pyauto.py |
for i in range(0, 5): | for i in range(5): | def find_o3d_root(): path = os.path.abspath(sys.path[0]) for i in range(0, 5): path = os.path.dirname(path) if (os.path.isdir(os.path.join(path, 'o3d')) and os.path.isdir(os.path.join(path, 'third_party'))): return path return '' | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] | paths = ['/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe'] | def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match # the layout of the prebuilt o3dConverter binaries. cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] for path in cur_dir_paths: if (os.path.exists(path)): return path # Last fallback is to use the binaries in o3d/third_party/cg/files. # Unfortunately, because we can't rely on the OS name, we have to # actually try running the cgc executable. o3d_root = find_o3d_root(); cg_root = os.path.join(o3d_root, 'third_party', 'cg', 'files') exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: try: subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe except: pass # We don't know where cgc lives. return '' | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] | cur_dir_paths = [os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe')] | def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match # the layout of the prebuilt o3dConverter binaries. cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] for path in cur_dir_paths: if (os.path.exists(path)): return path # Last fallback is to use the binaries in o3d/third_party/cg/files. # Unfortunately, because we can't rely on the OS name, we have to # actually try running the cgc executable. o3d_root = find_o3d_root(); cg_root = os.path.join(o3d_root, 'third_party', 'cg', 'files') exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: try: subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe except: pass # We don't know where cgc lives. return '' | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: | exe_paths = ['linux/bin/cgc', 'linux/bin64/cgc', 'mac/bin/cgc', 'win/bin/cgc.exe'] for exe_path in exe_paths: | def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match # the layout of the prebuilt o3dConverter binaries. cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] for path in cur_dir_paths: if (os.path.exists(path)): return path # Last fallback is to use the binaries in o3d/third_party/cg/files. # Unfortunately, because we can't rely on the OS name, we have to # actually try running the cgc executable. o3d_root = find_o3d_root(); cg_root = os.path.join(o3d_root, 'third_party', 'cg', 'files') exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: try: subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe except: pass # We don't know where cgc lives. return '' | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe | exe = os.path.join(cg_root, exe_path) return_code = subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) if return_code == 0 or return_code == 1: return exe | def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match # the layout of the prebuilt o3dConverter binaries. cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] for path in cur_dir_paths: if (os.path.exists(path)): return path # Last fallback is to use the binaries in o3d/third_party/cg/files. # Unfortunately, because we can't rely on the OS name, we have to # actually try running the cgc executable. o3d_root = find_o3d_root(); cg_root = os.path.join(o3d_root, 'third_party', 'cg', 'files') exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: try: subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe except: pass # We don't know where cgc lives. return '' | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
def check_cgc(CGC): if not os.path.exists(CGC): print >>sys.stderr, CGC+' is not found, use --cgc option to specify its' | def check_cgc(cgc_path): if not os.path.exists(cgc_path): print >>sys.stderr, (cgc_path + ' is not found, use --cgc option to specify its') | def check_cgc(CGC): if not os.path.exists(CGC): print >>sys.stderr, CGC+' is not found, use --cgc option to specify its' print >>sys.stderr, 'location. You may need to install nvidia cg toolkit.' sys.exit(1) | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
def cg_to_glsl(cg_shader, CGC): | def cg_to_glsl(cg_shader, cgc_path): | def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_vertex, err_v = p.communicate(cg_shader) fragment_entry = re.search(r'#o3d\s+PixelShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslf -entry %s' % fragment_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_fragment, err_f = p.communicate(cg_shader) log = ( '// glslv profile log:\n' + '\n'.join('// ' + l for l in err_v.splitlines()) + '\n\n' '// glslf profile log:\n' + '\n'.join('// ' + l for l in err_f.splitlines())) + '\n' return glsl_vertex, glsl_fragment, log | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % | p = subprocess.Popen([cgc_path]+('-profile glslv -entry %s' % | def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_vertex, err_v = p.communicate(cg_shader) fragment_entry = re.search(r'#o3d\s+PixelShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslf -entry %s' % fragment_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_fragment, err_f = p.communicate(cg_shader) log = ( '// glslv profile log:\n' + '\n'.join('// ' + l for l in err_v.splitlines()) + '\n\n' '// glslf profile log:\n' + '\n'.join('// ' + l for l in err_f.splitlines())) + '\n' return glsl_vertex, glsl_fragment, log | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
p = subprocess.Popen([CGC]+('-profile glslf -entry %s' % | p = subprocess.Popen([cgc_path]+('-profile glslf -entry %s' % | def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_vertex, err_v = p.communicate(cg_shader) fragment_entry = re.search(r'#o3d\s+PixelShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslf -entry %s' % fragment_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) glsl_fragment, err_f = p.communicate(cg_shader) log = ( '// glslv profile log:\n' + '\n'.join('// ' + l for l in err_v.splitlines()) + '\n\n' '// glslf profile log:\n' + '\n'.join('// ' + l for l in err_f.splitlines())) + '\n' return glsl_vertex, glsl_fragment, log | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
def main(cg_shader, CGC): | def main(cg_shader, cgc_path): | def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment) | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) | glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, cgc_path) | def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment) | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
CGC = default_cgc() | cgc_path = default_cgc() | def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment) | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
cmdline_parser.add_option('--cgc', dest='CGC', default=CGC, | cmdline_parser.add_option('--cgc', dest='cgc_path', default=cgc_path, | def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment) | b4063f4f2c6fc90bbda47a2fb5e91c437341938f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4063f4f2c6fc90bbda47a2fb5e91c437341938f/convert.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.