rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
args = self._LoadTestNamesFrom(pyauto_tests_file) args = args * self._options.repeat logging.debug("Loading %d tests from %s", len(args), args) loaded_tests = unittest.defaultTestLoader.loadTestsFromNames(args) return loaded_tests def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) | args = self._ExpandTestNamesFrom(pyauto_tests_file, self._options.suite) return args def _ExpandTestNamesFrom(self, filename, suite): """Load test names from the given file. Args: filename: the file to read the tests from suite: the name of the suite to load from |filename|. Returns: a list of test names [module.testcase.testX, module.testcase.testY, ..] """ suites = PyUITest.EvalDataFrom(filename) | 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 |
all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) | def _NamesInSuite(suite_name): logging.debug('Expanding suite %s' % suite_name) platforms = suites.get(suite_name) names = platforms.get('all', []) + \ platforms.get(self._platform_map[platform], []) ret = [] for name in names: if name.startswith('@'): ret.extend(_NamesInSuite(name[1:])) else: ret.append(name) return ret assert suite in suites, '%s: No such suite in %s' % (suite, filename) all_names = _NamesInSuite(suite) | def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
excluded.extend(self._GetTestsFromName(name[1:])) | excluded.extend(self._ImportTestsFromName(name[1:])) | def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
args.extend(self._GetTestsFromName(name)) | args.extend(self._ImportTestsFromName(name)) | def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
loaded_tests = self._LoadTests(self._args) | test_names = self._ExpandTestNames(self._args) test_names *= self._options.repeat logging.debug("Loading %d tests from %s", len(test_names), test_names) if self._options.list_tests: for name in test_names: print name sys.exit(0) loaded_tests = unittest.defaultTestLoader.loadTestsFromNames(test_names) | def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid()) | f46cb9be7f9b81256b5d7388b7f62184f59c54ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f46cb9be7f9b81256b5d7388b7f62184f59c54ea/pyauto.py |
2) file.Write(" file.Write(" | 3) file.Write(" file.Write(" | def WritePepperGLES2Interface(self, filename): """Writes the Pepper OpenGLES interface definition.""" file = CHeaderWriter( filename, "// This interface is used to access common and lite profile OpenGL ES " "2.0\n// functions.\n", 2) | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
file.Write("\ntypedef struct _ppb_OpenGLES {\n") | file.Write("\nstruct PPB_OpenGLES_Dev {\n") | file.Write("\ntypedef struct _ppb_OpenGLES {\n") | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
file.Write("} PPB_OpenGLES;\n\n") | file.Write("};\n\n") | file.Write("\ntypedef struct _ppb_OpenGLES {\n") | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
file.Write("\n | file.Write("\n | def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation.""" | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
file.Write("\nconst PPB_OpenGLES ppb_opengles = {\n") | file.Write("\nconst struct PPB_OpenGLES_Dev ppb_opengles = {\n") | def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation.""" | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
const PPB_OpenGLES* Graphics3D::GetOpenGLESInterface() { | const PPB_OpenGLES_Dev* Graphics3D::GetOpenGLESInterface() { | def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation.""" | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), | choices=("ppapi", "chrome_ppapi"), | def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1) | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") | gen.WritePepperGLES2Interface("ppapi/c/dev/ppb_opengles_dev.h") | def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1) | fa34f7f0b969cee4616b0a88cc66de6c8ff3746d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fa34f7f0b969cee4616b0a88cc66de6c8ff3746d/build_gles2_cmd_buffer.py |
'<a href="http://localhost:8888/echo">back to referring page</a></div>' | '<a href="/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.""" | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
print 'HTTPS server started on port %d...' % port | print 'HTTPS server started on port %d...' % 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, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
print 'HTTP server started on port %d...' % port | print 'HTTP server started on port %d...' % 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, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
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...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
||
print 'FTP server started on port %d...' % port | listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % 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...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
startup_pipe.write("READY") | 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...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.') | 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.') | 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...' % port else: server = StoppableHTTPServer(('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 server._sync_handler = None server._device_management_handler = None # 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) print 'FTP server started on port %d...' % 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") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 5ab608af9aba80652722e492890a88f283b72ccd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ab608af9aba80652722e492890a88f283b72ccd/testserver.py |
if not p == platform: new_options += p.upper() + ' ' | p = p.upper(); if not p in (platform.upper(), 'WIN-VISTA', 'WIN-7'): new_options += p + ' ' | def RemovePlatformFromFile(self, tests, platform, backup=False): """Remove the platform option from test expectations file. | d84b6e1036848c0f584707f0903200a7c2c345c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d84b6e1036848c0f584707f0903200a7c2c345c9/test_expectations.py |
'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', | 'Chromium Arm (dbg)', | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', 'Chromium Linux', 'Chromium Linux x64', 'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | f35757877d40b8d7d1d45e56c8dab5d7f86618cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f35757877d40b8d7d1d45e56c8dab5d7f86618cb/PRESUBMIT.py |
'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', 'Chromium Linux', 'Chromium Linux x64', 'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | f35757877d40b8d7d1d45e56c8dab5d7f86618cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f35757877d40b8d7d1d45e56c8dab5d7f86618cb/PRESUBMIT.py |
|
index = test.find(self.WEBKIT_PATH) | index = test.find(self.LAYOUT_TESTS_PATH) | def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH) | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
index += len(self.WEBKIT_PATH) | index += len(self.LAYOUT_TESTS_PATH) | def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH) | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test) | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
||
logging.error("results.json was not valid JSON. Clobbering.") | logging.debug("results.json was not valid JSON. Clobbering.") | def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test) | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
logging.error("Builder name (%s) is not in the results.json file." % | logging.debug("Builder name (%s) is not in the results.json file." % | def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test) | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == 1 and self.TESTS in results_json): LAYOUTTESTS_PREFIX = 'LayoutTests/' test_results = results_json[self.TESTS] for test in test_results.keys(): if test.startswith(LAYOUTTESTS_PREFIX): new_test = test[len(LAYOUTTESTS_PREFIX):] test_results[new_test] = test_results[test] del test_results[test] | if results_json[self.VERSION_KEY] == 2: for results_for_builder in results_json.itervalues(): try: test_results = results_for_builder[self.TESTS] except: continue for test in test_results: test_path = self._GetPathRelativeToLayoutTestRoot(test) if test_path != test: test_results[test_path] = test_results[test] del test_results[test] | 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 | 51fe99fe634b597a5852185b11b8dae0e9f38004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51fe99fe634b597a5852185b11b8dae0e9f38004/json_results_generator.py |
results.extend(CheckTreeIsOpen( | results.extend(input_api.canned_checks.CheckTreeIsOpen( | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py |
'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) | 'http://chromium-status.appspot.com/current?format=raw', '.*closed.*')) results.extend(input_api.canned_checks.CheckRietveldTryJobExecution(input_api, output_api, 'http://codereview.chromium.org', ('win', 'linux', 'mac'), '[email protected]')) | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py |
results.extend(CheckPendingBuilds( | results.extend(input_api.canned_checks.CheckBuildbotPendingBuilds( | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py |
'http://build.chromium.org/buildbot/waterfall/json/builders', | 'http://build.chromium.org/buildbot/waterfall/json/builders?filter=1', | def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results | edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py |
def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: return outputs values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify [email protected]. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs def CheckTreeIsOpen(input_api, output_api, url, closed, url_text): """Similar to the one in presubmit_canned_checks except it shows an helpful status text instead. """ assert(input_api.is_committing) try: connection = input_api.urllib2.urlopen(url) status = connection.read() connection.close() if input_api.re.match(closed, status): long_text = status + '\n' + url try: connection = input_api.urllib2.urlopen(url_text) long_text = connection.read().strip() connection.close() except IOError: pass return [output_api.PresubmitError("The tree is closed.", long_text=long_text)] except IOError: pass return [] def CheckPendingBuilds(input_api, output_api, url, max_pendings, ignored): try: connection = input_api.urllib2.urlopen(url) raw_data = connection.read() connection.close() try: import simplejson data = simplejson.loads(raw_data) except ImportError: patched_data = raw_data.replace('null', 'None') patched_data = patched_data.replace('false', 'False') patched_data = patched_data.replace('true', 'True') data = eval(patched_data) out = [] for (builder_name, builder) in data.iteritems(): if builder_name in ignored: continue pending_builds_len = len(builder.get('pending_builds', [])) if pending_builds_len > max_pendings: out.append('%s has %d build(s) pending' % (builder_name, pending_builds_len)) if out: return [output_api.PresubmitPromptWarning( 'Build(s) pending. It is suggested to wait that no more than %d ' 'builds are pending.' % max_pendings, long_text='\n'.join(out))] except IOError: pass return [] | def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) # platform|status|url values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: # It returned an empty list. Probably a private review. return outputs # Reformat as an dict of platform: [status, url] values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify [email protected]. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: # Fallback to no try job. # TODO(maruel): Change to a PresubmitPromptWarning once the try server is # stable enough and it seems to work fine. outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: # Another HTTP error happened, warn the user. # TODO(maruel): Change to a PresubmitPromptWarning once it deemed to work # fine. outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs | edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py |
|
class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): | class SyncHTTPServer(StoppableHTTPServer): """An HTTP server that handles sync commands.""" def __init__(self, server_address, request_handler_class): import chromiumsync self._sync_handler = chromiumsync.TestServer() StoppableHTTPServer.__init__(self, server_address, request_handler_class) def HandleCommand(self, query, raw_request): return self._sync_handler.HandleCommand(query, raw_request) class BasePageHandler(BaseHTTPServer.BaseHTTPRequestHandler): def __init__(self, request, client_address, socket_server, connect_handlers, get_handlers, post_handlers, put_handlers): self._connect_handlers = connect_handlers self._get_handlers = get_handlers self._post_handlers = post_handlers self._put_handlers = put_handlers BaseHTTPServer.BaseHTTPRequestHandler.__init__( self, request, client_address, socket_server) def log_request(self, *args, **kwargs): pass def _ShouldHandleRequest(self, handler_name): """Determines if the path can be handled by the handler. We consider a handler valid if the path begins with the handler name. It can optionally be followed by "?*", "/*". """ pattern = re.compile('%s($|\?|/).*' % handler_name) return pattern.match(self.path) def do_CONNECT(self): for handler in self._connect_handlers: if handler(): return def do_GET(self): for handler in self._get_handlers: if handler(): return def do_POST(self): for handler in self._post_handlers: if handler(): return def do_PUT(self): for handler in self._put_handlers: if handler(): return class TestPageHandler(BasePageHandler): | def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache, reqCert=self.ssl_client_auth, settings=self.ssl_handshake_settings, reqCAs=self.ssl_client_cas) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSAbruptCloseError: # Ignore abrupt close. return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
self._connect_handlers = [ | connect_handlers = [ | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
self._get_handlers = [ | get_handlers = [ | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
self.ChromiumSyncTimeHandler, | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
|
self._post_handlers = [ | post_handlers = [ | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
self.ChromiumSyncCommandHandler, | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
|
self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ | self.DeviceManagementHandler] + get_handlers put_handlers = [ | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
self.EchoHandler] + self._get_handlers | self.EchoHandler] + get_handlers | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, request, client_address, socket_server) def log_request(self, *args, **kwargs): pass def _ShouldHandleRequest(self, handler_name): """Determines if the path can be handled by the handler. We consider a handler valid if the path begins with the handler name. It can optionally be followed by "?*", "/*". """ pattern = re.compile('%s($|\?|/).*' % handler_name) return pattern.match(self.path) | BasePageHandler.__init__(self, request, client_address, socket_server, connect_handlers, get_handlers, post_handlers, put_handlers) | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
if not self.server._sync_handler: import chromiumsync self.server._sync_handler = chromiumsync.TestServer() http_response, raw_reply = self.server._sync_handler.HandleCommand( | http_response, raw_reply = self.server.HandleCommand( | def ChromiumSyncCommandHandler(self): """Handle a chromiumsync command arriving via http. | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
def MultipartHandler(self): """Send a multipart response (10 text/html pages).""" test_name = "/multipart" if not self._ShouldHandleRequest(test_name): return False num_frames = 10 bound = '12345' self.send_response(200) self.send_header('Content-type', 'multipart/x-mixed-replace;boundary=' + bound) self.end_headers() for i in xrange(num_frames): self.wfile.write('--' + bound + '\r\n') self.wfile.write('Content-type: text/html\r\n\r\n') self.wfile.write('<title>page ' + str(i) + '</title>') self.wfile.write('page ' + str(i)) self.wfile.write('--' + bound + '--') return True def DefaultResponseHandler(self): """This is the catch-all response handler for requests that aren't handled by one of the special handlers above. Note that we specify the content-length as without it the https connection is not closed properly (and the browser keeps expecting data).""" contents = "Default response given for path: " + self.path self.send_response(200) self.send_header('Content-type', 'text/html') self.send_header("Content-Length", len(contents)) self.end_headers() self.wfile.write(contents) return True def RedirectConnectHandler(self): """Sends a redirect to the CONNECT request for www.redirect.com. This response is not specified by the RFC, so the browser should not follow the redirect.""" if (self.path.find("www.redirect.com") < 0): return False dest = "http://www.destination.com/foo.js" self.send_response(302) self.send_header('Location', dest) self.send_header('Connection', 'close') self.end_headers() return True def ServerAuthConnectHandler(self): """Sends a 401 to the CONNECT request for www.server-auth.com. This response doesn't make sense because the proxy server cannot request server authentication.""" if (self.path.find("www.server-auth.com") < 0): return False challenge = 'Basic realm="WallyWorld"' self.send_response(401) self.send_header('WWW-Authenticate', challenge) self.send_header('Connection', 'close') self.end_headers() return True def DefaultConnectResponseHandler(self): """This is the catch-all response handler for CONNECT requests that aren't handled by one of the special handlers above. Real Web servers respond with 400 to CONNECT requests.""" contents = "Your client has issued a malformed or illegal request." self.send_response(400) self.send_header('Content-type', 'text/html') self.send_header("Content-Length", len(contents)) self.end_headers() self.wfile.write(contents) return True def DeviceManagementHandler(self): """Delegates to the device management service used for cloud policy.""" if not self._ShouldHandleRequest("/device_management"): return False length = int(self.headers.getheader('content-length')) raw_request = self.rfile.read(length) if not self.server._device_management_handler: import device_management policy_path = os.path.join(self.server.data_dir, 'device_management') self.server._device_management_handler = ( device_management.TestServer(policy_path)) http_response, raw_reply = ( self.server._device_management_handler.HandleRequest(self.path, self.headers, raw_request)) self.send_response(http_response) self.end_headers() self.wfile.write(raw_reply) return True def do_CONNECT(self): for handler in self._connect_handlers: if handler(): return def do_GET(self): for handler in self._get_handlers: if handler(): return def do_POST(self): for handler in self._post_handlers: if handler(): return def do_PUT(self): for handler in self._put_handlers: if handler(): return def sendRedirectHelp(self, redirect_name): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('<html><body><h1>Error: no redirect destination</h1>') self.wfile.write('Use <pre>%s?http://dest...</pre>' % redirect_name) self.wfile.write('</body></html>') | def MultipartHandler(self): """Send a multipart response (10 text/html pages).""" test_name = "/multipart" if not self._ShouldHandleRequest(test_name): return False | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
|
server._sync_handler = None | 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 server._sync_handler = None listen_port = server.server_port server._device_management_handler = None # 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 | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
|
help='FTP or HTTP server: default is HTTP.') | help='start up an FTP server.') option_parser.add_option('', '--sync', action='store_const', const=SERVER_SYNC, default=SERVER_HTTP, dest='server_type', help='start up a sync 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, 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 server._sync_handler = None listen_port = server.server_port server._device_management_handler = None # 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 | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py |
def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep) | b1e1f838ea983c532d38f30b7ad344427efd7508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1e1f838ea983c532d38f30b7ad344427efd7508/run_webkit_tests.py |
||
test_file = test_file[index + 1:] | test_file = test_file[index + len('LayoutTests/'):] | def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep) | b1e1f838ea983c532d38f30b7ad344427efd7508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1e1f838ea983c532d38f30b7ad344427efd7508/run_webkit_tests.py |
"""Print timing info by directory | """Print timing info by directory for any directories that take > 10 seconds to run. | def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory | b1e1f838ea983c532d38f30b7ad344427efd7508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1e1f838ea983c532d38f30b7ad344427efd7508/run_webkit_tests.py |
write("Time to process each subdirectory:") | write("Time to process slowest subdirectories:") min_seconds_to_print = 10 | def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory | b1e1f838ea983c532d38f30b7ad344427efd7508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1e1f838ea983c532d38f30b7ad344427efd7508/run_webkit_tests.py |
write(" %s took %s seconds to run %s tests." % (timing[1], timing[0], timing[2])) | if timing[0] > min_seconds_to_print: write(" %s took %s seconds to run %s tests." % (timing[1], timing[0], timing[2])) | def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory | b1e1f838ea983c532d38f30b7ad344427efd7508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b1e1f838ea983c532d38f30b7ad344427efd7508/run_webkit_tests.py |
self._tempfile = tempfile.TemporaryFile() | def __init__(self, args, executable, num_shards, shard): self._args = args self._executable = executable self._num_shards = num_shards self._shard = shard self._test = None self._tempfile = tempfile.TemporaryFile() | 6c19d1deba614cd5b00b06f284ce19516f8179e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c19d1deba614cd5b00b06f284ce19516f8179e5/parallel_launcher.py |
|
stdout=self._tempfile, | stdout=subprocess.PIPE, | def launch(self): env = os.environ.copy() env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) self._test = subprocess.Popen(args=self._args, executable=self._executable, stdout=self._tempfile, stderr=subprocess.STDOUT, env=env) | 6c19d1deba614cd5b00b06f284ce19516f8179e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c19d1deba614cd5b00b06f284ce19516f8179e5/parallel_launcher.py |
code = self._test.wait() self._tempfile.seek(0) print self._tempfile.read() self._tempfile.close() return code | if subprocess.mswindows: stdout_thread = threading.Thread( target=StreamCopyWindows, args=[self._test.stdout, sys.stdout]) stdout_thread.start() code = self._test.wait() stdout_thread.join() return code else: child_exited = threading.Event() stdout_thread = threading.Thread( target=StreamCopyPosix, args=[self._test.stdout, sys.stdout, child_exited]) stdout_thread.start() code = self._test.wait() child_exited.set() stdout_thread.join() return code | def wait(self): code = self._test.wait() self._tempfile.seek(0) print self._tempfile.read() self._tempfile.close() return code | 6c19d1deba614cd5b00b06f284ce19516f8179e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c19d1deba614cd5b00b06f284ce19516f8179e5/parallel_launcher.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 | 0ea08f6403e9f4b0fe3d2bbf70e08712f182053e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0ea08f6403e9f4b0fe3d2bbf70e08712f182053e/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 | 0ea08f6403e9f4b0fe3d2bbf70e08712f182053e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0ea08f6403e9f4b0fe3d2bbf70e08712f182053e/testserver.py |
import os import unittest import pyauto_functional import pyauto class FindMatchTests(pyauto.PyUITest): def testCanFindMatchCount(self): """Verify Find match count for valid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(1, self.FindInPage('title')['match_count']) def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count']) if __name__ == '__main__': pyauto_functional.Main() import os import unittest import pyauto_functional import pyauto class FindMatchTests(pyauto.PyUITest): def testCanFindMatchCount(self): """Verify Find match count for valid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(1, self.GetMatchCountForSearch('title')['match_count']) def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count']) if __name__ == '__main__': pyauto_functional.Main() import os import unittest import pyauto_functional import pyauto class FindMatchTests(pyauto.PyUITest): def testCanFindMatchCount(self): """Verify Find match count for valid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(1, self.GetMatchCountForSearch('title')['match_count']) def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count']) if __name__ == '__main__': pyauto_functional.Main() import os import unittest import pyauto_functional import pyauto class FindMatchTests(pyauto.PyUITest): def testCanFindMatchCount(self): """Verify Find match count for valid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(1, self.GetMatchCountForSearch('title')['match_count']) def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count']) if __name__ == '__main__': pyauto_functional.Main() | def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count']) | 14eb3fbe04d73da2d6ddbdac6d68e52a225acd24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/14eb3fbe04d73da2d6ddbdac6d68e52a225acd24/find_in_page.py |
|
tombstone.name = '' | tombstone.name = '' | def CommitEntry(self, entry, cache_guid, commit_session): """Attempt to commit one entry to the user's account. | 3b0afd700afdbe777a007e1a5fdcf4093a07cb81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3b0afd700afdbe777a007e1a5fdcf4093a07cb81/chromiumsync.py |
reply.parent_id_string = server_entry.parent_id_string | def HandleCommit(self, commit_message, commit_response): """Respond to a Commit request by updating the user's account state. | 3b0afd700afdbe777a007e1a5fdcf4093a07cb81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3b0afd700afdbe777a007e1a5fdcf4093a07cb81/chromiumsync.py |
|
"""Returns the file url for a dangerous download for this OS.""" | """Returns the file path for a dangerous download for this OS.""" | 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, 'invalid-dummy.dmg') return os.path.join(sub_path, 'dangerous.exe') | 2f9523102a5af33e57c781c28129ca5b8d22b231 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2f9523102a5af33e57c781c28129ca5b8d22b231/downloads.py |
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url) | downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path)) | 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)) self._ClearLocalDownloadState(downloaded_pkg) | 2f9523102a5af33e57c781c28129ca5b8d22b231 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2f9523102a5af33e57c781c28129ca5b8d22b231/downloads.py |
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url) | downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path)) | def testDeclineDangerousDownload(self): """Verify that we can decline dangerous downloads""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) | 2f9523102a5af33e57c781c28129ca5b8d22b231 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2f9523102a5af33e57c781c28129ca5b8d22b231/downloads.py |
file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url) | downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path)) | def testNoUnsafeDownloadsOnRestart(self): """Verify that unsafe file should not show up on session restart.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self.assertTrue(self.IsDownloadShelfVisible()) # Restart the browser and assert that the download was removed. self.RestartBrowser(clear_profile=False) self.assertFalse(os.path.exists(downloaded_pkg)) self.assertFalse(self.IsDownloadShelfVisible()) self.NavigateToURL("chrome://downloads") self.assertFalse(self.GetDownloadsInfo().Downloads()) | 2f9523102a5af33e57c781c28129ca5b8d22b231 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2f9523102a5af33e57c781c28129ca5b8d22b231/downloads.py |
print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' | logging.info('coverage_posix.py: doing a "cd .." ' 'to accomodate Linux/make PWD') | def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') elif self.IsMac(): pass | d9931d54b1d1c3ab8db89291cb5574e88c6cade8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9931d54b1d1c3ab8db89291cb5574e88c6cade8/coverage_posix.py |
print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' | logging.info('coverage_posix.py: doing a "cd src" ' 'to accomodate buildbot PWD') | def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') elif self.IsMac(): pass | d9931d54b1d1c3ab8db89291cb5574e88c6cade8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d9931d54b1d1c3ab8db89291cb5574e88c6cade8/coverage_posix.py |
"""This is handler dumps the content of POST request to a disk file into the data_dir/dump. Sub-directories are not supported.""" | """This is handler dumps the content of POST/PUT request to a disk file into the data_dir/dump. Sub-directories are not supported.""" | def WriteFile(self): """This is handler dumps the content of POST request to a disk file into the data_dir/dump. Sub-directories are not supported.""" | bc2e8a8c1241909e8289e8779767c3e860a0ab17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc2e8a8c1241909e8289e8779767c3e860a0ab17/testserver.py |
if self.command == 'POST': | if self.command == 'POST' or self.command == 'PUT': | def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" | bc2e8a8c1241909e8289e8779767c3e860a0ab17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc2e8a8c1241909e8289e8779767c3e860a0ab17/testserver.py |
if self.command == 'POST': | if self.command == 'POST' or self.command == 'PUT' : | def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!""" | bc2e8a8c1241909e8289e8779767c3e860a0ab17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc2e8a8c1241909e8289e8779767c3e860a0ab17/testserver.py |
"""Create directory named 'dump' where uploaded data via HTTP POST request will be stored. If the directory already exists all files and subdirectories will be deleted.""" | """Create directory named 'dump' where uploaded data via HTTP POST/PUT requests will be stored. If the directory already exists all files and subdirectories will be deleted.""" | def MakeDumpDir(data_dir): """Create directory named 'dump' where uploaded data via HTTP POST request will be stored. If the directory already exists all files and subdirectories will be deleted.""" dump_dir = os.path.join(data_dir, 'dump'); if os.path.isdir(dump_dir): shutil.rmtree(dump_dir) os.mkdir(dump_dir) | bc2e8a8c1241909e8289e8779767c3e860a0ab17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc2e8a8c1241909e8289e8779767c3e860a0ab17/testserver.py |
step = (num_tests + 1) / 2 | FUNCTIONS_PER_FILE = 98 | def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | c30a233166deb867ed545b3e0898dfb2e75a589c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c30a233166deb867ed545b3e0898dfb2e75a589c/build_gles2_cmd_buffer.py |
for test_num in range(0, num_tests, step): | for test_num in range(0, num_tests, FUNCTIONS_PER_FILE): | def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | c30a233166deb867ed545b3e0898dfb2e75a589c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c30a233166deb867ed545b3e0898dfb2e75a589c/build_gles2_cmd_buffer.py |
end = test_num + step | end = test_num + FUNCTIONS_PER_FILE | def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file) | c30a233166deb867ed545b3e0898dfb2e75a589c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c30a233166deb867ed545b3e0898dfb2e75a589c/build_gles2_cmd_buffer.py |
if is_sane: return return_code else: | if check_sanity and not is_sane: | def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports. | 7338ca1db59618f53677023dfb8d3cf12c10777a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7338ca1db59618f53677023dfb8d3cf12c10777a/heapcheck_test.py |
def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func) | def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func) | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
need_validation_ = ['GLsizei*', 'GLboolean*', 'GLenum*', 'GLint*'] | def __init__(self, info, type_handler): for key in info: setattr(self, key, info[key]) self.type_handler = type_handler if not 'type' in info: self.type = '' | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
def WriteDestinationInitalizationValidation(self, file, func): """Writes the client side destintion initialization validation.""" pass def WriteDestinationInitalizationValidatationIfNeeded(self, file, func): """Writes the client side destintion initialization validation if needed.""" parts = self.type.split(" ") if len(parts) > 1: return if parts[0] in self.need_validation_: file.Write(" GL_CLIENT_VALIDATE_DESTINATION_INITALIZATION(%s, %s);\n" % (self.type[:-1], self.name)) | def WriteClientSideValidationCode(self, file, func): """Writes the validation code for an argument.""" pass | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func) | def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func) | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func) | def GetImmediateVersion(self): """Overridden from Argument.""" return None | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func) | def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return BucketPointerArgument(self.name, self.type) | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
def WriteDestinationInitalizationValidation(self, file): """Writes the client side destintion initialization validation.""" self.type_handler.WriteDestinationInitalizationValidation(self, file) | def WriteGLES2ImplementationHeader(self, file): """Writes the GLES2 Implemention declaration.""" self.type_handler.WriteGLES2ImplementationHeader(self, file) | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
func.WriteDestinationInitalizationValidation(file) | def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n") | aaac7103f5260edebf7bdc287b0b59e94d419cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/aaac7103f5260edebf7bdc287b0b59e94d419cc8/build_gles2_cmd_buffer.py |
|
locals = {'Var': lambda _: ''} | locals = {'Var': lambda _: locals["vars"][_]} | def GetWebKitRev(): """Extract the 'webkit_revision' variable out of DEPS.""" locals = {'Var': lambda _: ''} execfile('DEPS', {}, locals) return locals['vars']['webkit_revision'] | ee72a56ba8374352d80e8c6208eabd0f438fc9f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/ee72a56ba8374352d80e8c6208eabd0f438fc9f0/sync-webkit-git.py |
BUILD_EXE_NAME = "chrome" | BUILD_EXE_NAME = 'chrome' | def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" | BUILD_EXE_NAME = 'Chromium.app/Contents/MacOS/Chromium' | def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
BUILD_EXE_NAME = "chrome.exe" | BUILD_EXE_NAME = 'chrome.exe' | def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("Could not retrieve the download. Sorry.") | print('Could not retrieve the download. Sorry.') | def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) | print 'Unziping ...' UnzipFilenameToDir(BUILD_ZIP_NAME, os.curdir) | def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) | exe = os.path.join(os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME) cmd = '%s %s' % (exe, flags) print 'Running %s' % cmd os.system(cmd) | def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev)) if response and response in ("g", "b"): return response == "g" | response = raw_input('\nBuild %d is [(g)ood/(b)ad]: ' % int(rev)) if response and response in ('g', 'b'): return response == 'g' | def AskIsGoodBuild(rev): """Ask the user whether build |rev| is good or bad.""" # Loop until we get a response that we can parse. while True: response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev)) if response and response in ("g", "b"): return response == "g" | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) | BUILD_LATEST_URL = '%s/LATEST' % (BUILD_BASE_URL) | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): | bad_rev = raw_input('Bad revision [HEAD:%d]: ' % latest) if (bad_rev == ''): | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) | print('Could not determine latest revision. This could be bad...') bad_rev = int(raw_input('Bad revision: ')) | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
good_rev = int(raw_input("Last known good [0]: ")) | good_rev = int(raw_input('Last known good [0]: ')) | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print "We don't have enough builds to bisect. revlist: %s" % revlist | print 'We don\'t have enough builds to bisect. revlist: %s' % revlist | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("%d candidates. %d tries left." % | print('%d candidates. %d tries left.' % | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("Candidates: %s" % revlist[good:bad]) | print('Candidates: %s' % revlist[good:bad]) | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") | print('You are probably looking for build %d.' % revlist[bad]) print('CHANGELOG URL:') | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
print("Built at revision:") | print('Built at revision:') | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | 02d09ff36aee01d534a3b286ed0ea9934b6b02d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/02d09ff36aee01d534a3b286ed0ea9934b6b02d7/build-bisect.py |
r'temp_scaffolding_stubs\.h$', | # Bogus ifdef tricks | 1ab5a668ea470c1dde83c1fca4244f7713a1bca7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ab5a668ea470c1dde83c1fca4244f7713a1bca7/PRESUBMIT.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.