rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
(filename, e.errno, e.strerror))
(filename, e.errno, e.strerror))
def ReadFile(filename): try: file = open(filename, 'r') except IOError, e: print >> sys.stderr, ('I/O Error reading file %s(%s): %s' % (filename, e.errno, e.strerror)) raise e if not file: return None contents = file.read() file.close() return contents
2611fae0fc9831e6c5f2d0b8b1b2caefda76749c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2611fae0fc9831e6c5f2d0b8b1b2caefda76749c/make_expectations.py
if not file: return None
def ReadFile(filename): try: file = open(filename, 'r') except IOError, e: print >> sys.stderr, ('I/O Error reading file %s(%s): %s' % (filename, e.errno, e.strerror)) raise e if not file: return None contents = file.read() file.close() return contents
2611fae0fc9831e6c5f2d0b8b1b2caefda76749c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2611fae0fc9831e6c5f2d0b8b1b2caefda76749c/make_expectations.py
pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf')
pdf_files_path = os.path.join(self.DataDir(), 'plugin', 'pdf')
def testPDFRunner(self): """Navigate to pdf files and verify that browser doesn't crash""" # bail out if not a branded build properties = self.GetBrowserInfo()['properties'] if properties['branding'] != 'Google Chrome': return pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) for pdf_file in pdf_files: url = self.GetFileURLForPath(os.path.join(pdf_files_path, pdf_file)) self.AppendTab(pyauto.GURL(url)) for tab_index in range(1, len(pdf_files) + 1): self.ActivateTab(tab_index) self._PerformPDFAction('fitToHeight', tab_index=tab_index) self._PerformPDFAction('fitToWidth', tab_index=tab_index) # Assert that there is at least 1 browser window. self.assertTrue(self.GetBrowserWindowCount(), 'Browser crashed, no window is open')
0f3a714d221bd73f36bc3a9c21230668a3649740 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0f3a714d221bd73f36bc3a9c21230668a3649740/pdf.py
samples.sort(lambda x,y: cmp(x['name'].upper(), y['name'].upper()))
def compareSamples(sample1, sample2): """ Compares two samples as a sort comparator, by name then path. """ value = cmp(sample1['name'].upper(), sample2['name'].upper()) if value == 0: value = cmp(sample1['path'], sample2['path']) return value samples.sort(compareSamples)
def _parseManifestData(self, manifest_paths, api_manifest): """ Returns metadata about the sample extensions given their manifest paths.
990414a5ad56d1cd0aeb691b4f06b9460c058921 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/990414a5ad56d1cd0aeb691b4f06b9460c058921/directory.py
def __init__(self, server_address, request_hander_class, cert_path):
def __init__(self, server_address, request_hander_class, cert_path, ssl_client_auth):
def __init__(self, server_address, request_hander_class, cert_path): s = open(cert_path).read() x509 = tlslite.api.X509() x509.parse(s) self.cert_chain = tlslite.api.X509CertChain([x509]) s = open(cert_path).read() self.private_key = tlslite.api.parsePEMKey(s, private=True)
b940ded2f8be403e1d19cc628d74d0ca83312dde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b940ded2f8be403e1d19cc628d74d0ca83312dde/testserver.py
sessionCache=self.session_cache)
sessionCache=self.session_cache, reqCert=self.ssl_client_auth)
def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False
b940ded2f8be403e1d19cc628d74d0ca83312dde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b940ded2f8be403e1d19cc628d74d0ca83312dde/testserver.py
server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert)
server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth)
def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified cert file not found: ' + options.cert + ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert) 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 MakeDumpDir(server.data_dir) # means FTP Server else: my_data_dir = MakeDataDir() def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer pyftpdlib.ftpserver.logline = line_logger # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
b940ded2f8be403e1d19cc628d74d0ca83312dde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b940ded2f8be403e1d19cc628d74d0ca83312dde/testserver.py
metadata = ParseDir(path)
try: metadata = ParseDir(path) except LicenseError: print >>sys.stderr, ("WARNING: licensing info for " + path + " is incomplete, skipping.") continue
def EvaluateTemplate(template, env, escape=True): """Expand a template with variables like {{foo}} using a dictionary of expansions.""" for key, val in env.items(): if escape: val = cgi.escape(val) template = template.replace('{{%s}}' % key, val) return template
0af039e4950a5fa1485e4c6c49e0af4614d98cf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0af039e4950a5fa1485e4c6c49e0af4614d98cf0/licenses.py
pyauto_utils.RemovePath(os.path.join(download_dir, name))
self.files_to_remove.append(os.path.join(download_dir, name))
def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: pyauto_utils.RemovePath(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(self)
82b82740e3826022b41e938416349ddd5caaf5cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/82b82740e3826022b41e938416349ddd5caaf5cc/downloads.py
os.path.exists(file_path) and os.remove(file_path)
self.files_to_remove.append(file_path)
def testCancelDownload(self): """Verify that we can cancel a download.""" # Create a big file (250 MB) on the fly, so that the download won't finish # before being cancelled. file_path = self._MakeFile(2**28) file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self.PerformActionOnDownload(self._GetDownloadId(), 'cancel') os.path.exists(file_path) and os.remove(file_path)
82b82740e3826022b41e938416349ddd5caaf5cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/82b82740e3826022b41e938416349ddd5caaf5cc/downloads.py
urllib.urlretrieve(download_url, BUILD_ZIP_NAME)
urllib.urlretrieve(download_url, BUILD_ZIP_NAME, _Reporthook) print
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 'Unziping ...' UnzipFilenameToDir(BUILD_ZIP_NAME, os.curdir) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) exe = os.path.join(os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME) cmd = '%s %s' % (exe, flags) print 'Running %s' % cmd os.system(cmd) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
6ad3b2f81e30b63588810b891ef17aa98afa9942 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6ad3b2f81e30b63588810b891ef17aa98afa9942/build-bisect.py
tombstone = sync_pb2.SyncEntity() tombstone.id_string = entry.id_string tombstone.deleted = True tombstone.name = '' entry = tombstone
def MakeTombstone(id_string): """Make a tombstone entry that will replace the entry being deleted. Args: id_string: Index of the SyncEntity to be deleted. Returns: A new SyncEntity reflecting the fact that the entry is deleted. """ tombstone = sync_pb2.SyncEntity() tombstone.id_string = id_string tombstone.deleted = True tombstone.name = '' return tombstone def IsChild(child_id): """Check if a SyncEntity is a child of entry, or any of its children. Args: child_id: Index of the SyncEntity that is a possible child of entry. Returns: True if it is a child; false otherwise. """ if child_id not in self._entries: return False if self._entries[child_id].parent_id_string == entry.id_string: return True return IsChild(self._entries[child_id].parent_id_string) child_ids = [] for possible_child in self._entries.itervalues(): if IsChild(possible_child.id_string): child_ids.append(possible_child.id_string) for child_id in child_ids: self._SaveEntry(MakeTombstone(child_id)) entry = MakeTombstone(entry.id_string)
def CommitEntry(self, entry, cache_guid, commit_session): """Attempt to commit one entry to the user's account.
36fd968ba8b27b494cf2b1665496c31a36826def /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/36fd968ba8b27b494cf2b1665496c31a36826def/chromiumsync.py
def CommitEntry(self, entry, cache_guid, commit_session): """Attempt to commit one entry to the user's account.
36fd968ba8b27b494cf2b1665496c31a36826def /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/36fd968ba8b27b494cf2b1665496c31a36826def/chromiumsync.py
data = eval(raw_data.replace('null', 'None'))
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)
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: # simplejson is much safer. But we should be just fine enough with that: data = eval(raw_data.replace('null', 'None')) 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: # Silently pass. pass return []
e181b21a9e65284ff9a8686b79261e92fe22b889 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e181b21a9e65284ff9a8686b79261e92fe22b889/PRESUBMIT.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
24571f4d2f036756d7661440d8db27f99d30aa5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/24571f4d2f036756d7661440d8db27f99d30aa5a/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
24571f4d2f036756d7661440d8db27f99d30aa5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/24571f4d2f036756d7661440d8db27f99d30aa5a/testserver.py
startup_pipe.write(struct.pack('@H', listen_port))
startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(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: 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
a1ceb02d41f5956cad1d296c7215e34d78c8803f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a1ceb02d41f5956cad1d296c7215e34d78c8803f/testserver.py
def CheckChangeOnUpload(input_api, output_api):
_LICENSE_HEADER = ( r".*? Copyright \(c\) 20\d\d The Chromium Authors\. All rights reserved\." "\n" r".*? Use of this source code is governed by a BSD-style license that can " "be\n" r".*? found in the LICENSE file\." "\n" ) def _CommonChecks(input_api, output_api):
def CheckChangeOnUpload(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) return results
f92520aecd35259e11b9a675f1242d5ba575f834 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f92520aecd35259e11b9a675f1242d5ba575f834/PRESUBMIT.py
black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api))
results.extend(_CommonChecks(input_api, output_api))
def CheckChangeOnCommit(input_api, output_api): results = [] black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( 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
f92520aecd35259e11b9a675f1242d5ba575f834 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f92520aecd35259e11b9a675f1242d5ba575f834/PRESUBMIT.py
self._indirect_analyze_results_file = ""
def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser) self._indirect_analyze_results_file = ""
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
def GetAnalyzeResultsIndirect(self): assert self._indirect_analyze_results_file != "" f = open(self._indirect_analyze_results_file) if f: if len([True for l in f.readlines() if "FAIL" in l]) > 0: logging.error("There were some Valgrind reports in the tests!") print "-------------------------------------------------------------" print "The reports for the individual tests are placed in the output" print "of the tests. Please search for \"FAIL!\" lines in this log." print "-------------------------------------------------------------" return 1 return 0
def GetAnalyzeResultsIndirect(self): assert self._indirect_analyze_results_file != "" f = open(self._indirect_analyze_results_file) if f: if len([True for l in f.readlines() if "FAIL" in l]) > 0: logging.error("There were some Valgrind reports in the tests!") print "-------------------------------------------------------------" print "The reports for the individual tests are placed in the output" print "of the tests. Please search for \"FAIL!\" lines in this log." print "-------------------------------------------------------------" return 1 return 0
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1] analyze_script = os.path.join(self._source_dir, 'tools', 'valgrind', self.ToolName() + '_analyze.py')
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
f.write('echo "Started Valgrind wrapper for this test, PID=$$"\n')
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
f.write("EXITCODE=$?\n") logs_list = logfiles.replace("%p", "$$.*") f.write("python %s %s || echo FAIL >>%s\n" \ % (analyze_script, logs_list, self._indirect_analyze_results_file)) f.write("rm %s\n" % logs_list) f.write("exit $EXITCODE\n")
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ # We'll be storing the analyzed results of individual tests # in a temporary text file self._indirect_analyze_results_file = tempfile.mkstemp( dir=self.TMP_DIR, prefix="valgrind_analyze.", text=True)[1]
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
if self._options.indirect: return self.GetAnalyzeResultsIndirect() filenames = glob.glob(self.TMP_DIR + "/memcheck.*") use_gdb = common.IsMac() analyzer = memcheck_analyze.MemcheckAnalyze(self._source_dir, filenames, self._options.show_all_leaks, use_gdb=use_gdb) ret = analyzer.Report(check_sanity)
ret = self.GetAnalyzeResults(check_sanity)
def Analyze(self, check_sanity=False): if self._options.indirect: return self.GetAnalyzeResultsIndirect() # Glob all the files in the "valgrind.tmp" directory filenames = glob.glob(self.TMP_DIR + "/memcheck.*")
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
def Analyze(self, check_sanity=False): filenames = glob.glob(self.TMP_DIR + "/tsan.*") use_gdb = common.IsMac() analyzer = tsan_analyze.TsanAnalyze(self._source_dir, filenames, use_gdb=use_gdb) ret = analyzer.Report(check_sanity) if ret != 0: logging.info("Please see http://dev.chromium.org/developers/how-tos/" "using-valgrind/threadsanitizer for the info on " "ThreadSanitizer") return ret
def Analyze(self, check_sanity=False): filenames = glob.glob(self.TMP_DIR + "/tsan.*") use_gdb = common.IsMac() analyzer = tsan_analyze.TsanAnalyze(self._source_dir, filenames, use_gdb=use_gdb) ret = analyzer.Report(check_sanity) if ret != 0: logging.info("Please see http://dev.chromium.org/developers/how-tos/" "using-valgrind/threadsanitizer for the info on " "ThreadSanitizer") return ret
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
def Analyze(self, check_sanity=False): if self._options.indirect: return ValgrindTool.GetAnalyzeResultsIndirect(self) return ThreadSanitizerBase.Analyze(self, check_sanity)
def __init__(self): ValgrindTool.__init__(self) ThreadSanitizerBase.__init__(self)
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
"--timeout=120000",
"--timeout=180000",
def TestUI(self): return self.SimpleTest("chrome", "ui_tests", valgrind_test_args=[ "--timeout=120000", "--trace_children", "--indirect"], cmd_args=[ "--ui-test-timeout=120000", "--ui-test-action-timeout=80000", "--ui-test-action-max-timeout=180000", "--ui-test-terminate-timeout=60000"])
e14a345f15b4474f95c58904e17e5bda36d7313c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e14a345f15b4474f95c58904e17e5bda36d7313c/chrome_tests.py
"--ui-test-timeout=120000", "--ui-test-action-timeout=80000",
"--ui-test-timeout=180000", "--ui-test-action-timeout=120000",
def TestUI(self): return self.SimpleTest("chrome", "ui_tests", valgrind_test_args=[ "--timeout=120000", "--trace_children", "--indirect"], cmd_args=[ "--ui-test-timeout=120000", "--ui-test-action-timeout=80000", "--ui-test-action-max-timeout=180000", "--ui-test-terminate-timeout=60000"])
e14a345f15b4474f95c58904e17e5bda36d7313c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e14a345f15b4474f95c58904e17e5bda36d7313c/chrome_tests.py
"--ui-test-terminate-timeout=60000"])
"--ui-test-terminate-timeout=120000"])
def TestUI(self): return self.SimpleTest("chrome", "ui_tests", valgrind_test_args=[ "--timeout=120000", "--trace_children", "--indirect"], cmd_args=[ "--ui-test-timeout=120000", "--ui-test-action-timeout=80000", "--ui-test-action-max-timeout=180000", "--ui-test-terminate-timeout=60000"])
e14a345f15b4474f95c58904e17e5bda36d7313c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e14a345f15b4474f95c58904e17e5bda36d7313c/chrome_tests.py
now = time.time()
def testForge(self): """Brief test of forging history items.
e50027fd002a1c4392a5b043a18480291b688c19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e50027fd002a1c4392a5b043a18480291b688c19/history.py
'time': now})
'time': new_time})
def testForge(self): """Brief test of forging history items.
e50027fd002a1c4392a5b043a18480291b688c19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e50027fd002a1c4392a5b043a18480291b688c19/history.py
self.assertTrue(abs(now - history[0]['time']) < 1.0)
self.assertTrue(abs(new_time - history[0]['time']) < 1.0)
def testForge(self): """Brief test of forging history items.
e50027fd002a1c4392a5b043a18480291b688c19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e50027fd002a1c4392a5b043a18480291b688c19/history.py
def _ClickTranslateUntilSuccess(self):
def _ClickTranslateUntilSuccess(self, window_index=0, tab_index=0):
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fail('Translation failed more than %d times.' % max_tries)
bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d/translate.py
while curr_try < max_tries and not self.ClickTranslateBarTranslate():
while (curr_try < max_tries and not self.ClickTranslateBarTranslate(window_index=window_index, tab_index=tab_index)):
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fail('Translation failed more than %d times.' % max_tries)
bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d/translate.py
if curr_try == 10:
if curr_try == max_tries:
def _ClickTranslateUntilSuccess(self): """Since the translate can fail due to server error, continue trying until it is successful or until it has tried too many times.""" max_tries = 10 curr_try = 0 while curr_try < max_tries and not self.ClickTranslateBarTranslate(): curr_try = curr_try + 1 if curr_try == 10: self.fail('Translation failed more than %d times.' % max_tries)
bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d/translate.py
self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate') self._ClickTranslateUntilSuccess()
self.NavigateToURL("http://www.news.google.com") self.AppendTab(pyauto.GURL("http://www.google.com/webhp?hl=es")) self.WaitForInfobarCount(1, tab_index=1) translate_info = self.GetTranslateInfo(tab_index=1) self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate', tab_index=1) self._ClickTranslateUntilSuccess(tab_index=1)
def testSessionRestore(self): """Test that session restore restores the translate infobar and other translate settings. """ self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate') self._ClickTranslateUntilSuccess() self.SetPrefs(pyauto.kRestoreOnStartup, 1) self.RestartBrowser(clear_profile=False) self.WaitForInfobarCount(1) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) # Sometimes translation fails. We don't really care whether it succeededs, # just that a translation was attempted. self.assertNotEqual(self.before_translate, translate_info['translate_bar']['bar_state'])
bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d/translate.py
self.WaitForInfobarCount(1) translate_info = self.GetTranslateInfo()
self.WaitForInfobarCount(1, tab_index=1) self.WaitUntilTranslateComplete() translate_info = self.GetTranslateInfo(tab_index=1)
def testSessionRestore(self): """Test that session restore restores the translate infobar and other translate settings. """ self._NavigateAndWaitForBar(self._GetDefaultSpanishURL()) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) self.SelectTranslateOption('toggle_always_translate') self._ClickTranslateUntilSuccess() self.SetPrefs(pyauto.kRestoreOnStartup, 1) self.RestartBrowser(clear_profile=False) self.WaitForInfobarCount(1) translate_info = self.GetTranslateInfo() self.assertTrue('translate_bar' in translate_info) # Sometimes translation fails. We don't really care whether it succeededs, # just that a translation was attempted. self.assertNotEqual(self.before_translate, translate_info['translate_bar']['bar_state'])
bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc1c20e7d6c410e0e8422070d8abe3a8beaa3f5d/translate.py
self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "sync": self.TestSync, "sync_unit_tests": self.TestSync, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, } if test not in self._test_list:
if ':' in test: (self._test, self._gtest_filter) = test.split(':', 1) else: self._test = test self._gtest_filter = options.gtest_filter if self._test not in self._test_list:
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "sync": self.TestSync, "sync_unit_tests": self.TestSync, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, }
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
self._test = test
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "sync": self.TestSync, "sync_unit_tests": self.TestSync, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, }
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
return self._test_list[self._test]()
return self._test_list[self._test](self)
def Run(self): ''' Runs the test specified by command-line argument --test ''' logging.info("running test %s" % (self._test)) return self._test_list[self._test]()
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
gtest_filter = self._options.gtest_filter
gtest_filter = self._gtest_filter
def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ self._options.valgrind_tool)] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.join(directory, name + ".gtest-%s_%s.txt" % \ (self._options.valgrind_tool, platform_suffix))] for filename in gtest_filter_files: if os.path.exists(filename): logging.info("reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith("#") or line.startswith("//") or line.isspace(): continue line = line.rstrip() filters.append(line) gtest_filter = self._options.gtest_filter if len(filters): if gtest_filter: gtest_filter += ":" if gtest_filter.find("-") < 0: gtest_filter += "-" else: gtest_filter = "-" gtest_filter += ":".join(filters) if gtest_filter: cmd.append("--gtest_filter=%s" % gtest_filter)
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
parser.add_option("-t", "--test", action="append", help="which test to run")
parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.")
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the output of the compiler output") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option("-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
if not options.test or not len(options.test):
if not options.test:
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the output of the compiler output") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option("-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
12b088258129428dc1801ea3c18d209258507ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/12b088258129428dc1801ea3c18d209258507ff6/chrome_tests.py
stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]*\s*([^\n]*)')
stack_line = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]+\s*([^\n]*)')
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
f33cb836ae54c81434ddacec1ae0326a40f46727 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f33cb836ae54c81434ddacec1ae0326a40f46727/heapcheck_test.py
reports = map(lambda(x): map(str, x), a)
reports = map(lambda(x): map(str, x), reports)
def GetReports(self, files): '''Extracts reports from a set of files.
761e577532c39e0792cc57a794fd3028436de714 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/761e577532c39e0792cc57a794fd3028436de714/tsan_analyze.py
return self.SimpleTest("chrome", "remoting_unittests")
return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests")
e1471b09b1aa21a0cc045be123d36866fc4c9b62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e1471b09b1aa21a0cc045be123d36866fc4c9b62/chrome_tests.py
proc += ["-logdir", (os.getcwd() + "\\" + self.temp_dir)]
proc += ["-logdir", self.temp_dir]
def ToolCommand(self): """Get the valgrind command to run.""" tool_name = self.ToolName()
457528630b8710ff1ff24d65db33ed7a68a248f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/457528630b8710ff1ff24d65db33ed7a68a248f6/valgrind_test.py
if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'):
if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'linux-chromiumos'):
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
2bd3b91c6417d02027f746a4af2e97cde3f094e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2bd3b91c6417d02027f746a4af2e97cde3f094e2/build-bisect.py
choices = ['mac', 'xp', 'linux', 'linux-64']
choices = ['mac', 'xp', 'linux', 'linux-64', 'linux-chromiumos']
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])
2bd3b91c6417d02027f746a4af2e97cde3f094e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2bd3b91c6417d02027f746a4af2e97cde3f094e2/build-bisect.py
if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)]
while len(dir): if dir in BLACKLIST_DIRS: return [] if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)] dir = os.path.dirname(dir)
def CheckChange(input_api, output_api): for f in input_api.AffectedFiles(): dir = os.path.normpath(input_api.os_path.dirname(f.LocalPath())) if dir in DEPENDENT_DIRS: return [output_api.PresubmitPromptWarning(REBUILD_WARNING)] return []
6d5fb296da1289e609ed2bc5e86d0f9460ae2042 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6d5fb296da1289e609ed2bc5e86d0f9460ae2042/PRESUBMIT.py
def __init__(self, name, type): SizeArgument.__init__(self, name, "GLsizei")
def __init__(self, name, type, gl_type): SizeArgument.__init__(self, name, gl_type)
def __init__(self, name, type): SizeArgument.__init__(self, name, "GLsizei")
0a93dd5abe4872c4e82284847005b9da2174055d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0a93dd5abe4872c4e82284847005b9da2174055d/build_gles2_cmd_buffer.py
arg_parts[0] != "GLintptr"):
not arg_parts[0].startswith('GLintptr')):
def CreateArg(arg_string): """Creates an Argument.""" arg_parts = arg_string.split() if len(arg_parts) == 1 and arg_parts[0] == 'void': return None # Is this a pointer argument? elif arg_string.find('*') >= 0: if arg_parts[0] == 'NonImmediate': return NonImmediatePointerArgument( arg_parts[-1], " ".join(arg_parts[1:-1])) else: return PointerArgument( arg_parts[-1], " ".join(arg_parts[0:-1])) # Is this a resource argument? Must come after pointer check. elif arg_parts[0].startswith('GLidBind'): return ResourceIdBindArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLidZero'): return ResourceIdZeroArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLid'): return ResourceIdArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLenum') and len(arg_parts[0]) > 6: return EnumArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLboolean') and len(arg_parts[0]) > 9: return BoolArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif (arg_parts[0].startswith('GLint') and len(arg_parts[0]) > 5 and arg_parts[0] != "GLintptr"): return IntArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLsizeiNotNegative'): return SizeNotNegativeArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLsize'): return SizeArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) else: return Argument(arg_parts[-1], " ".join(arg_parts[0:-1]))
0a93dd5abe4872c4e82284847005b9da2174055d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0a93dd5abe4872c4e82284847005b9da2174055d/build_gles2_cmd_buffer.py
elif arg_parts[0].startswith('GLsizeiNotNegative'): return SizeNotNegativeArgument(arg_parts[-1], " ".join(arg_parts[0:-1]))
elif (arg_parts[0].startswith('GLsizeiNotNegative') or arg_parts[0].startswith('GLintptrNotNegative')): return SizeNotNegativeArgument(arg_parts[-1], " ".join(arg_parts[0:-1]), arg_parts[0][0:-11])
def CreateArg(arg_string): """Creates an Argument.""" arg_parts = arg_string.split() if len(arg_parts) == 1 and arg_parts[0] == 'void': return None # Is this a pointer argument? elif arg_string.find('*') >= 0: if arg_parts[0] == 'NonImmediate': return NonImmediatePointerArgument( arg_parts[-1], " ".join(arg_parts[1:-1])) else: return PointerArgument( arg_parts[-1], " ".join(arg_parts[0:-1])) # Is this a resource argument? Must come after pointer check. elif arg_parts[0].startswith('GLidBind'): return ResourceIdBindArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLidZero'): return ResourceIdZeroArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLid'): return ResourceIdArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLenum') and len(arg_parts[0]) > 6: return EnumArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLboolean') and len(arg_parts[0]) > 9: return BoolArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif (arg_parts[0].startswith('GLint') and len(arg_parts[0]) > 5 and arg_parts[0] != "GLintptr"): return IntArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLsizeiNotNegative'): return SizeNotNegativeArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) elif arg_parts[0].startswith('GLsize'): return SizeArgument(arg_parts[-1], " ".join(arg_parts[0:-1])) else: return Argument(arg_parts[-1], " ".join(arg_parts[0:-1]))
0a93dd5abe4872c4e82284847005b9da2174055d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0a93dd5abe4872c4e82284847005b9da2174055d/build_gles2_cmd_buffer.py
" .WillOnce(SetArgumentPointee<2>(strlen(kInfo)));") % (
" .WillOnce(SetArgumentPointee<2>(strlen(kInfo) + 1));") % (
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
781be2ded1df2fd52e261693cb2f62d53c35cdb5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/781be2ded1df2fd52e261693cb2f62d53c35cdb5/build_gles2_cmd_buffer.py
"""Verify toolbar buttons prefs.."""
"""Verify toolbar buttons prefs."""
def testToolbarButtonsPref(self): """Verify toolbar buttons prefs..""" # Assert defaults first self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) self.SetPrefs(pyauto.kShowHomeButton, True) self.RestartBrowser(clear_profile=False) self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton))
3e3bb819d5bd6cb3d719463b2a7fe8fbce92ff2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3e3bb819d5bd6cb3d719463b2a7fe8fbce92ff2a/prefs.py
def testDnsPrefectchingEnabledPref(self):
def testDnsPrefetchingEnabledPref(self):
def testDnsPrefectchingEnabledPref(self): """Verify DNS prefetching pref.""" # Assert default self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kDnsPrefetchingEnabled)) self.SetPrefs(pyauto.kDnsPrefetchingEnabled, False) self.RestartBrowser(clear_profile=False) self.assertFalse(self.GetPrefsInfo().Prefs(pyauto.kDnsPrefetchingEnabled))
3e3bb819d5bd6cb3d719463b2a7fe8fbce92ff2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3e3bb819d5bd6cb3d719463b2a7fe8fbce92ff2a/prefs.py
return self.SimpleTest("chrome", "remoting_unittests")
return self.SimpleTest("chrome", "remoting_unittests", cmd_args=[ "--ui-test-timeout=240000", "--ui-test-action-timeout=120000", "--ui-test-action-max-timeout=280000"])
def TestRemoting(self): return self.SimpleTest("chrome", "remoting_unittests")
afdc527faecd2c6d6005320ef59c18dfdcf59599 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/afdc527faecd2c6d6005320ef59c18dfdcf59599/chrome_tests.py
'third_party', 'WebKit', 'WebKitTools', 'pywebsocket')
'third_party', 'WebKit', 'WebKitTools', 'Scripts', 'webkitpy', 'thirdparty', 'pywebsocket')
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
924d706fda763645f8d4ac928791f8f97575f55b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/924d706fda763645f8d4ac928791f8f97575f55b/websocket_server.py
'third_party', 'WebKit', 'WebKitTools', 'pywebsocket', 'mod_pywebsocket', 'standalone.py')
'third_party', 'WebKit', 'WebKitTools', 'Scripts', 'webkitpy', 'thirdparty', 'pywebsocket', 'mod_pywebsocket', 'standalone.py')
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
924d706fda763645f8d4ac928791f8f97575f55b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/924d706fda763645f8d4ac928791f8f97575f55b/websocket_server.py
return os.path.splitext(basename)[0]
while 1: new_basename = os.path.splitext(basename)[0] if basename == new_basename: break else: basename = new_basename return basename
def ExtractModuleName(infile_path): """Infers the module name from the input file path. The input filename is supposed to be in the form "ModuleName.sigs". This function splits the filename from the extention on that basename of the path and returns that as the module name. Args: infile_path: String holding the path to the input file. Returns: The module name as a string. """ basename = os.path.basename(infile_path) return os.path.splitext(basename)[0]
a7aa64b6e7525fa285abee08d6ea511e4d4ba41b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a7aa64b6e7525fa285abee08d6ea511e4d4ba41b/generate_stubs.py
fd, file_path = tempfile.mkstemp(suffix='.zip', prefix='file-')
fd, file_path = tempfile.mkstemp(suffix='.zip', prefix='file-downloads-')
def _MakeFile(self, size): """Make a file on-the-fly with the given size. Returns the path to the file. """ fd, file_path = tempfile.mkstemp(suffix='.zip', prefix='file-') os.lseek(fd, size, 0) os.write(fd, 'a') os.close(fd) return file_path
8e0daf09511a151a6386fdc3c1f277c6814387aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8e0daf09511a151a6386fdc3c1f277c6814387aa/downloads.py
self._macCodeSign(browser_info)
self._MacCodeSign(browser_info)
def testCodeSign(self): """Check the app for codesign and bail out if it's non-branded.""" browser_info = self.GetBrowserInfo()
bf1b20e40af2cccb5245740478524383b5353b3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bf1b20e40af2cccb5245740478524383b5353b3c/codesign.py
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]):
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[], expect_retval=None):
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
Waits until the |function| evalues to True or until |timeout| secs, whichever occurs earlier.
Waits until the |function| evalues to |expect_retval| or until |timeout| secs, whichever occurs earlier.
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
timeout = self.action_max_timeout_ms()/1000.0
timeout = self.action_max_timeout_ms() / 1000.0
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
if function(*args):
retval = function(*args) if (expect_retval is None and retval) or expect_retval == retval:
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
cmd_dict = { 'command': 'WaitForInfobarCount', 'count': count, 'tab_index': tab_index, }
def WaitForInfobarCount(self, count, windex=0, tab_index=0): """Wait until infobar count becomes |count|.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
return self.WaitUntil( lambda(count): len(self.GetBrowserInfo()\ ['windows'][windex]['tabs'][tab_index]['infobars']) == count, args=[count])
def _InfobarCount(): windows = self.GetBrowserInfo()['windows'] if windex >= len(windows): return -1 tabs = windows[windex]['tabs'] if tab_index >= len(tabs): return -1 return len(tabs[tab_index]['infobars']) return self.WaitUntil(_InfobarCount, expect_retval=count)
def WaitForInfobarCount(self, count, windex=0, tab_index=0): """Wait until infobar count becomes |count|.
91228cf9e257aa62f3e55a2d23dc75a2b99223cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/91228cf9e257aa62f3e55a2d23dc75a2b99223cb/pyauto.py
filename_queue.put('.', [self._get_test_info_for_file(test_file)])
filename_queue.put( ('.', [self._GetTestInfoForFile(test_file)]))
def _get_test_file_queue(self, test_files): """Create the thread safe queue of lists of (test filenames, test URIs) tuples. Each TestShellThread pulls a list from this queue and runs those tests in order before grabbing the next available list.
de73bcff1a19de9f2afa5e51a2abc7370a58261b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/de73bcff1a19de9f2afa5e51a2abc7370a58261b/run_chromium_webkit_tests.py
'glue', 'editor_client_impl.cc')
'api', 'src','EditorClientImpl.cc')
def AddWebKitEditorActions(actions): """Add editor actions from editor_client_impl.cc. Arguments: actions: set of actions to add to. """ action_re = re.compile(r'''\{ [\w']+, +\w+, +"(.*)" +\},''') editor_file = os.path.join(path_utils.ScriptDir(), '..', '..', 'webkit', 'glue', 'editor_client_impl.cc') for line in open(editor_file): match = action_re.search(line) if match: # Plain call to RecordAction actions.add(match.group(1))
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(')
global number_of_files_total number_of_files_total = number_of_files_total + 1 action_re = re.compile(r'UserMetricsAction\("([^"]*)')
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re = re.compile(r'UserMetrics::RecordComputedAction') for line in open(path): match = action_re.search(line) if match: # Plain call to RecordAction actions.add(match.group(1)) elif other_action_re.search(line): # Warn if this file shouldn't be mentioning RecordAction. if os.path.basename(path) != 'user_metrics.cc': print >>sys.stderr, 'WARNING: %s has funny RecordAction' % path elif computed_action_re.search(line): # Warn if this file shouldn't be calling RecordComputedAction. if os.path.basename(path) not in KNOWN_COMPUTED_USERS: print >>sys.stderr, 'WARNING: %s has RecordComputedAction' % path
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
elif other_action_re.search(line): if os.path.basename(path) != 'user_metrics.cc': print >>sys.stderr, 'WARNING: %s has funny RecordAction' % path
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re = re.compile(r'UserMetrics::RecordComputedAction') for line in open(path): match = action_re.search(line) if match: # Plain call to RecordAction actions.add(match.group(1)) elif other_action_re.search(line): # Warn if this file shouldn't be mentioning RecordAction. if os.path.basename(path) != 'user_metrics.cc': print >>sys.stderr, 'WARNING: %s has funny RecordAction' % path elif computed_action_re.search(line): # Warn if this file shouldn't be calling RecordComputedAction. if os.path.basename(path) not in KNOWN_COMPUTED_USERS: print >>sys.stderr, 'WARNING: %s has RecordComputedAction' % path
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
print >>sys.stderr, 'WARNING: %s has RecordComputedAction' % path
print >>sys.stderr, 'WARNING: {0} has RecordComputedAction at {1}'.\ format(path, line_number)
def GrepForActions(path, actions): """Grep a source file for calls to UserMetrics functions. Arguments: path: path to the file actions: set of actions to add to """ action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(L"(.*)"') other_action_re = re.compile(r'[> ]UserMetrics:?:?RecordAction\(') computed_action_re = re.compile(r'UserMetrics::RecordComputedAction') for line in open(path): match = action_re.search(line) if match: # Plain call to RecordAction actions.add(match.group(1)) elif other_action_re.search(line): # Warn if this file shouldn't be mentioning RecordAction. if os.path.basename(path) != 'user_metrics.cc': print >>sys.stderr, 'WARNING: %s has funny RecordAction' % path elif computed_action_re.search(line): # Warn if this file shouldn't be calling RecordComputedAction. if os.path.basename(path) not in KNOWN_COMPUTED_USERS: print >>sys.stderr, 'WARNING: %s has RecordComputedAction' % path
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
if ext == '.cc':
if ext in ('.cc', '.mm', '.c', '.m'):
def WalkDirectory(root_path, actions): for path, dirs, files in os.walk(root_path): if '.svn' in dirs: dirs.remove('.svn') for file in files: ext = os.path.splitext(file)[1] if ext == '.cc': GrepForActions(os.path.join(path, file), actions)
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
AddWebKitEditorActions(actions)
def main(argv): actions = set() AddComputedActions(actions) AddWebKitEditorActions(actions) # Walk the source tree to process all .cc files. chrome_root = os.path.join(path_utils.ScriptDir(), '..') WalkDirectory(chrome_root, actions) webkit_root = os.path.join(path_utils.ScriptDir(), '..', '..', 'webkit') WalkDirectory(os.path.join(webkit_root, 'glue'), actions) WalkDirectory(os.path.join(webkit_root, 'port'), actions) # Print out the actions as a sorted list. for action in sorted(actions): print action
53d51d208e5e097ceae9eebdc8be7f377edb4476 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/53d51d208e5e097ceae9eebdc8be7f377edb4476/extract_actions.py
file_url = self.GetFileURLForDataPath(os.path.join(
file_url = self.GetFileURLForPath(os.path.join(
def _TriggerUnsafeDownload(self, filename, tab_index=0, windex=0): """Trigger download of an unsafe/dangerous filetype.
c5dcef97b214630cd25c390482dc3a04a2350c80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c5dcef97b214630cd25c390482dc3a04a2350c80/downloads.py
self._source_dir = layout_package.path_utils.GetAbsolutePath(
self._source_dir = layout_package.path_utils.get_absolute_path(
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, "ipc": self.TestIpc, "ipc_tests": self.TestIpc, "layout": self.TestLayout, "layout_tests": self.TestLayout, "media": self.TestMedia, "media_unittests": self.TestMedia, "net": self.TestNet, "net_unittests": self.TestNet, "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, "startup": self.TestStartup, "startup_tests": self.TestStartup, "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, "ui": self.TestUI, "ui_tests": self.TestUI, "unit": self.TestUnit, "unit_tests": self.TestUnit, "app": self.TestApp, "app_unittests": self.TestApp, }
50f8998d873e0ba6148925747f72ac46ed6a4497 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/50f8998d873e0ba6148925747f72ac46ed6a4497/chrome_tests.py
short_options = 'f:i:o:t:h' long_options = ['file=', 'help']
short_options = 'e:f:i:o:t:h' long_options = ['eval=', 'file=', 'help']
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
c8129a7d22911e39505983228c0c7f417b62478f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c8129a7d22911e39505983228c0c7f417b62478f/version.py
if o in ('-f', '--file'):
if o in ('-e', '--eval'): try: evals.update(dict([a.split('=',1)])) except ValueError: raise Usage("-e requires VAR=VAL") elif o in ('-f', '--file'):
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
c8129a7d22911e39505983228c0c7f417b62478f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c8129a7d22911e39505983228c0c7f417b62478f/version.py
sys.stderr.write('Use -h to get help.')
sys.stderr.write('; Use -h to get help.\n')
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
c8129a7d22911e39505983228c0c7f417b62478f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c8129a7d22911e39505983228c0c7f417b62478f/version.py
for key, val in evals.iteritems(): values[key] = str(eval(val, globals(), values))
def main(argv=None): if argv is None: argv = sys.argv short_options = 'f:i:o:t:h' long_options = ['file=', 'help'] helpstr = """\
c8129a7d22911e39505983228c0c7f417b62478f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c8129a7d22911e39505983228c0c7f417b62478f/version.py
current_dir = input_api.PresubmitLocalPath()
current_dir = str(input_api.PresubmitLocalPath())
def LintTestFiles(input_api, output_api): current_dir = input_api.PresubmitLocalPath() # Set 'webkit/tools/layout_tests' in include path. python_paths = [ current_dir, input_api.os_path.join(current_dir, '..', '..', '..', 'tools', 'python') ] env = input_api.environ.copy() if env.get('PYTHONPATH'): python_paths.append(env['PYTHONPATH']) env['PYTHONPATH'] = input_api.os_path.pathsep.join(python_paths) args = [ input_api.python_executable, input_api.os_path.join(current_dir, 'run_webkit_tests.py'), '--lint-test-files' ] subproc = input_api.subprocess.Popen( args, cwd=current_dir, env=env, stdin=input_api.subprocess.PIPE, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT) stdout_data = subproc.communicate()[0] # TODO(ukai): consolidate run_webkit_tests --lint-test-files reports. is_error = lambda line: (input_api.re.match('^Line:', line) or input_api.re.search('ERROR Line:', line)) error = filter(is_error, stdout_data.splitlines()) if error: return [output_api.PresubmitError('Lint error\n%s' % '\n'.join(error), long_text=stdout_data)] return []
c2a2855bf15809c6583f9c30b783befcfecf9672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c2a2855bf15809c6583f9c30b783befcfecf9672/PRESUBMIT.py
file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
if func.can_auto_generate and (impl_func == None or impl_func == True):
impl_decl = func.GetInfo('impl_decl') if (func.can_auto_generate and (impl_func == None or impl_func == True) and (impl_decl == None or impl_decl == True)):
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file)
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" FreeIds(%s);\n" % func.MakeOriginalArgString("")) file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n")
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result;
impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result;
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) all_but_last_args = func.GetOriginalArgs()[:-1] arg_string = ( ", ".join(["%s" % arg.name for arg in all_but_last_args])) code = """ typedef %(func_name)s::Result Result;
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
helper_->%(func_name)s(%(arg_string)s, result_shm_id(), result_shm_offset());
helper_->%(func_name)s(%(arg_string)s, result_shm_id(), result_shm_offset());
code = """ typedef %(func_name)s::Result Result;
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
file.Write(code % { 'func_name': func.name, 'arg_string': arg_string, })
file.Write(code % { 'func_name': func.name, 'arg_string': arg_string, })
code = """ typedef %(func_name)s::Result Result;
fcdeee1f879e446039b9900f160c32ef0b95ad52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/fcdeee1f879e446039b9900f160c32ef0b95ad52/build_gles2_cmd_buffer.py
print('usage: %s order.html input_file_1 input_file_2 ... '
print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... '
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor = OrderedJSFilesExtractor(argv[1]) output = StringIO() for input_file_name in extractor.ordered_js_files: if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1])) output.write('/* %s */\n\n' % input_file_name) input_file = open(full_paths[input_file_name], 'r') output.write(input_file.read()) output.write('\n') input_file.close() output_file = open(output_file_name, 'w') output_file.write(output.getvalue()) output_file.close() output.close() # Touch output file directory to make sure that Xcode will copy # modified resource files. if sys.platform == 'darwin': output_dir_name = os.path.dirname(output_file_name) os.utime(output_dir_name, None)
0e20df92d79799ae285040cb0cf1d5fb898e9db2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0e20df92d79799ae285040cb0cf1d5fb898e9db2/concatenate_js_files.py
full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor = OrderedJSFilesExtractor(argv[1]) output = StringIO() for input_file_name in extractor.ordered_js_files: if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1])) output.write('/* %s */\n\n' % input_file_name) input_file = open(full_paths[input_file_name], 'r') output.write(input_file.read()) output.write('\n') input_file.close() output_file = open(output_file_name, 'w') output_file.write(output.getvalue()) output_file.close() output.close() # Touch output file directory to make sure that Xcode will copy # modified resource files. if sys.platform == 'darwin': output_dir_name = os.path.dirname(output_file_name) os.utime(output_dir_name, None)
0e20df92d79799ae285040cb0cf1d5fb898e9db2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0e20df92d79799ae285040cb0cf1d5fb898e9db2/concatenate_js_files.py
if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1]))
full_path = expander.expand(input_file_name) if (full_path is None): raise Exception('File %s referenced in %s not found on any source paths, ' 'check source tree for consistency' % (input_file_name, input_file_name))
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor = OrderedJSFilesExtractor(argv[1]) output = StringIO() for input_file_name in extractor.ordered_js_files: if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1])) output.write('/* %s */\n\n' % input_file_name) input_file = open(full_paths[input_file_name], 'r') output.write(input_file.read()) output.write('\n') input_file.close() output_file = open(output_file_name, 'w') output_file.write(output.getvalue()) output_file.close() output.close() # Touch output file directory to make sure that Xcode will copy # modified resource files. if sys.platform == 'darwin': output_dir_name = os.path.dirname(output_file_name) os.utime(output_dir_name, None)
0e20df92d79799ae285040cb0cf1d5fb898e9db2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0e20df92d79799ae285040cb0cf1d5fb898e9db2/concatenate_js_files.py
input_file = open(full_paths[input_file_name], 'r')
input_file = open(full_path, 'r')
def main(argv): if len(argv) < 3: print('usage: %s order.html input_file_1 input_file_2 ... ' 'output_file' % argv[0]) return 1 output_file_name = argv.pop() full_paths = {} for full_path in argv[2:]: file_name = os.path.basename(full_path) if file_name.endswith('.js'): full_paths[file_name] = full_path extractor = OrderedJSFilesExtractor(argv[1]) output = StringIO() for input_file_name in extractor.ordered_js_files: if not input_file_name in full_paths: print('A full path to %s isn\'t specified in command line. ' 'Probably, you have an obsolete script entry in %s' % (input_file_name, argv[1])) output.write('/* %s */\n\n' % input_file_name) input_file = open(full_paths[input_file_name], 'r') output.write(input_file.read()) output.write('\n') input_file.close() output_file = open(output_file_name, 'w') output_file.write(output.getvalue()) output_file.close() output.close() # Touch output file directory to make sure that Xcode will copy # modified resource files. if sys.platform == 'darwin': output_dir_name = os.path.dirname(output_file_name) os.utime(output_dir_name, None)
0e20df92d79799ae285040cb0cf1d5fb898e9db2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/0e20df92d79799ae285040cb0cf1d5fb898e9db2/concatenate_js_files.py
if os.path.exists(BaseTool.TMP_DIR): shutil.rmtree(BaseTool.TMP_DIR) os.mkdir(BaseTool.TMP_DIR)
self.temp_dir = tempfile.mkdtemp()
def __init__(self): # If we have a testing.tmp directory, we didn't cleanup last time. if os.path.exists(BaseTool.TMP_DIR): shutil.rmtree(BaseTool.TMP_DIR) os.mkdir(BaseTool.TMP_DIR)
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
shutil.rmtree(self.TMP_DIR, ignore_errors=True)
shutil.rmtree(self.temp_dir, ignore_errors=True)
def Main(self, args, check_sanity): """Call this to run through the whole process: Setup, Execute, Analyze""" start = datetime.datetime.now() retcode = -1 if self.Setup(args): retcode = self.RunTestsAndAnalyze(check_sanity) if not self._nocleanup_on_exit: shutil.rmtree(self.TMP_DIR, ignore_errors=True) self.Cleanup() else: logging.error("Setup failed") end = datetime.datetime.now() seconds = (end - start).seconds hours = seconds / 3600 seconds = seconds % 3600 minutes = seconds / 60 seconds = seconds % 60 logging.info("elapsed time: %02d:%02d:%02d" % (hours, minutes, seconds)) return retcode
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
logfilename = self.TMP_DIR + ("/%s." % tool_name) + "%p"
logfilename = self.temp_dir + ("/%s." % tool_name) + "%p"
def ToolCommand(self): """Get the valgrind command to run.""" # Note that self._args begins with the exe to be run. tool_name = self.ToolName()
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
(fd, indirect_fname) = tempfile.mkstemp(dir=self.TMP_DIR,
(fd, indirect_fname) = tempfile.mkstemp(dir=self.temp_dir,
def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ (fd, indirect_fname) = tempfile.mkstemp(dir=self.TMP_DIR, prefix="browser_wrapper.", text=True) f = os.fdopen(fd, "w") f.write("#!/bin/sh\n") f.write('echo "Started Valgrind wrapper for this test, PID=$$"\n') # Add the PID of the browser wrapper to the logfile names so we can # separate log files for different UI tests at the analyze stage. f.write(command.replace("%p", "$$.%p")) f.write(' "$@"\n') f.close() os.chmod(indirect_fname, stat.S_IRUSR|stat.S_IXUSR) os.putenv("BROWSER_WRAPPER", indirect_fname) logging.info('export BROWSER_WRAPPER=' + indirect_fname)
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
filenames = glob.glob(self.TMP_DIR + "/" + self.ToolName() + ".*")
filenames = glob.glob(self.temp_dir + "/" + self.ToolName() + ".*")
def GetAnalyzeResults(self, check_sanity=False): # Glob all the files in the "testing.tmp" directory filenames = glob.glob(self.TMP_DIR + "/" + self.ToolName() + ".*")
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
logfilename = self.TMP_DIR + "/tsan.%p"
logfilename = self.temp_dir + "/tsan.%p"
def ToolSpecificFlags(self): proc = ThreadSanitizerBase.ToolSpecificFlags(self) # On PIN, ThreadSanitizer has its own suppression mechanism # and --log-file flag which work exactly on Valgrind. suppression_count = 0 for suppression_file in self._options.suppressions: if os.path.exists(suppression_file): suppression_count += 1 proc += ["--suppressions=%s" % suppression_file]
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
filenames = glob.glob(self.TMP_DIR + "/tsan.*")
filenames = glob.glob(self.temp_dir + "/tsan.*")
def Analyze(self, check_sanity=False): filenames = glob.glob(self.TMP_DIR + "/tsan.*") analyzer = tsan_analyze.TsanAnalyzer(self._source_dir) ret = analyzer.Report(filenames, check_sanity) if ret != 0: logging.info(self.INFO_MESSAGE) return ret
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py