rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
SetGLError(error); | SetGLError(error, NULL); | code = """ typedef %(func_name)s::Result Result; | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): | def WriteValidationCode(self, file, func): | def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteClientSideValidationCode(self, file): | def WriteClientSideValidationCode(self, file, func): | def WriteClientSideValidationCode(self, file): """Writes the validation code for an argument.""" pass | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): | def WriteValidationCode(self, file, func): | def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
file.Write(" SetGLError(GL_INVALID_VALUE);\n") | file.Write(" SetGLError(GL_INVALID_VALUE, \"gl%s: %s < 0\");\n" % (func.original_name, self.name)) | def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteClientSideValidationCode(self, file): | def WriteClientSideValidationCode(self, file, func): | def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
file.Write(" SetGLError(GL_INVALID_VALUE);\n") | file.Write(" SetGLError(GL_INVALID_VALUE, \"gl%s: %s < 0\");\n" % (func.original_name, self.name)) | def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): | def WriteValidationCode(self, file, func): | def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return error::kNoError;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
file.Write(" SetGLError(%s);\n" % self.gl_error) | file.Write(" SetGLError(%s, \"gl%s: %s %s\");\n" % (self.gl_error, func.original_name, self.name, self.gl_error)) | def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) file.Write(" return error::kNoError;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): | def WriteValidationCode(self, file, func): | def WriteValidationCode(self, file): """Overridden from Argument.""" file.Write(" if (%s == NULL) {\n" % self.name) file.Write(" return error::kOutOfBounds;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
def WriteValidationCode(self, file): | def WriteValidationCode(self, file, func): | def WriteValidationCode(self, file): """Overridden from Argument.""" file.Write(" if (%s == NULL) {\n" % self.name) file.Write(" return error::kOutOfBounds;\n") file.Write(" }\n") | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
arg.WriteValidationCode(file) | arg.WriteValidationCode(file, self) | def WriteHandlerValidation(self, file): """Writes validation code for the function.""" for arg in self.GetOriginalArgs(): arg.WriteValidationCode(file) self.WriteValidationCode(file) | bda273cb982a1cc60958aa574bc939271a82f552 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bda273cb982a1cc60958aa574bc939271a82f552/build_gles2_cmd_buffer.py |
p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform=='win32')) | proc = subprocess.Popen(['git', 'log', '-999'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform=='win32')) for line in proc.stdout: match = git_re.search(line) if match: id = match.group(2) if id: proc.stdout.close() return id | def git_fetch_id(): """ Fetch the GIT identifier for the local tree. Errors are swallowed. """ try: p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform=='win32')) except OSError: # 'git' is apparently either not installed or not executable. return None id = None if p: git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) m = git_re.search(p.stdout.read()) if m: id = m.group(2) return id | 26d0299aa5d6db0e7d013aa0137b4746a1f53492 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/26d0299aa5d6db0e7d013aa0137b4746a1f53492/lastchange.py |
return None id = None if p: git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) m = git_re.search(p.stdout.read()) if m: id = m.group(2) return id | pass return None | def git_fetch_id(): """ Fetch the GIT identifier for the local tree. Errors are swallowed. """ try: p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform=='win32')) except OSError: # 'git' is apparently either not installed or not executable. return None id = None if p: git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) m = git_re.search(p.stdout.read()) if m: id = m.group(2) return id | 26d0299aa5d6db0e7d013aa0137b4746a1f53492 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/26d0299aa5d6db0e7d013aa0137b4746a1f53492/lastchange.py |
self._old_path = None if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ: self._old_path = os.environ['DYLD_FALLBACK_LIBRARY_PATH'] os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = os.path.join( self.DataDir(), 'firefox3_nss_mac') | def setUp(self): self._to_import = ['ALL'] | 9a0eb89590f2b637b792cb8728dc249eb55a0a01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9a0eb89590f2b637b792cb8728dc249eb55a0a01/imports.py |
|
if self.IsMac(): if self._old_path: os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = self._old_path else: os.environ.pop('DYLD_FALLBACK_LIBRARY_PATH') | def tearDown(self): pyauto.PyUITest.tearDown(self) # Re-set the path to its state before the test. if self.IsMac(): if self._old_path: os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = self._old_path else: os.environ.pop('DYLD_FALLBACK_LIBRARY_PATH') # Delete any replacers to restore the original profiles. if self._safari_replacer: del self._safari_replacer if self._firefox_replacer: del self._firefox_replacer | 9a0eb89590f2b637b792cb8728dc249eb55a0a01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9a0eb89590f2b637b792cb8728dc249eb55a0a01/imports.py |
|
self.ImportSettings('Mozilla Firefox', False, ['ALL']) | self.ImportSettings('Mozilla Firefox', False, self._to_import) | def testFirefoxImportFromPrefs(self): """Verify importing Firefox data through preferences.""" self._SwapFirefoxProfile() self.ImportSettings('Mozilla Firefox', False, ['ALL']) self._CheckDefaults(bookmarks=True, history=True, passwords=True, home_page=False, search_engines=True) | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Mozilla Firefox', True, ['ALL']) | self.ImportSettings('Mozilla Firefox', True, self._to_import) | def testFirefoxFirstRun(self): """Verify importing from Firefox on the first run. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Mozilla Firefox', False, ['ALL']) | self.ImportSettings('Mozilla Firefox', False, self._to_import) | def testImportFirefoxDataTwice(self): """Verify importing Firefox data twice. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Mozilla Firefox', False, ['ALL']) | self.ImportSettings('Mozilla Firefox', False, self._to_import) | def testImportFirefoxDataTwice(self): """Verify importing Firefox data twice. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Mozilla Firefox', False, ['ALL']) self.ImportSettings('Safari', False, ['ALL']) | self.ImportSettings('Mozilla Firefox', False, self._to_import) self.ImportSettings('Safari', False, self._to_import) | def testImportFromFirefoxAndSafari(self): """Verify importing from Firefox and then Safari.""" # This test is for Mac only. if not self.IsMac(): return | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Safari', False, ['ALL']) | self.ImportSettings('Safari', False, self._to_import) | def testSafariImportFromPrefs(self): """Verify importing Safari data through preferences.""" # This test is Mac only. if not self.IsMac(): return self._SwapSafariProfile() self.ImportSettings('Safari', False, ['ALL']) self._CheckDefaults(bookmarks=True, history=True, passwords=False, home_page=False, search_engines=True) | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Safari', False, ['ALL']) | self.ImportSettings('Safari', False, self._to_import) | def testSafariFirstRun(self): """Verify importing Safari data on the first run.""" # This test is Mac only. if not self.IsMac(): return self._SwapSafariProfile() self.ImportSettings('Safari', False, ['ALL']) self._CheckDefaults(bookmarks=True, history=True, passwords=False, home_page=False, search_engines=False) | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Safari', False, ['ALL']) | self.ImportSettings('Safari', False, self._to_import) | def testImportSafariDataTwice(self): """Verify importing Safari data twice. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
self.ImportSettings('Safari', False, ['ALL']) | self.ImportSettings('Safari', False, self._to_import) | def testImportSafariDataTwice(self): """Verify importing Safari data twice. | 98d75b89680c12c09bb081ebf1cdbbeed7c61eb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/98d75b89680c12c09bb081ebf1cdbbeed7c61eb6/imports.py |
TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) | TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) | def gatherFrames(node, source_dir): frames = [] for frame in node.getElementsByTagName("frame"): frame_dict = { INSTRUCTION_POINTER : getTextOf(frame, INSTRUCTION_POINTER), OBJECT_FILE : getTextOf(frame, OBJECT_FILE), FUNCTION_NAME : getTextOf(frame, FUNCTION_NAME), SRC_FILE_DIR : removeCommonRoot( source_dir, getTextOf(frame, SRC_FILE_DIR)), SRC_FILE_NAME : getTextOf(frame, SRC_FILE_NAME), SRC_LINE : getTextOf(frame, SRC_LINE) } frames += [frame_dict] if frame_dict[FUNCTION_NAME] in _TOP_OF_STACK_POINTS: break global TheAddressTable if TheAddressTable != None and frame_dict[SRC_LINE] == "": # Try using gdb TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) return frames | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py |
SANITY_TEST_SUPPRESSIONS = [ "Memcheck sanity test (array deleted without []).", "Memcheck sanity test (malloc/read left).", "Memcheck sanity test (malloc/read right).", "Memcheck sanity test (malloc/write left).", "Memcheck sanity test (malloc/write right).", "Memcheck sanity test (memory leak).", "Memcheck sanity test (new/read left).", "Memcheck sanity test (new/read right).", "Memcheck sanity test (new/write left).", "Memcheck sanity test (new/write right).", "Memcheck sanity test (single element deleted with []).", "Memcheck sanity test (write after delete).", "Memcheck sanity test (write after free).", ] | SANITY_TEST_SUPPRESSIONS_LINUX = { "Memcheck sanity test 01 (memory leak).": 1, "Memcheck sanity test 02 (malloc/read left).": 1, "Memcheck sanity test 03 (malloc/read right).": 1, "Memcheck sanity test 04 (malloc/write left).": 1, "Memcheck sanity test 05 (malloc/write right).": 1, "Memcheck sanity test 06 (new/read left).": 1, "Memcheck sanity test 07 (new/read right).": 1, "Memcheck sanity test 08 (new/write left).": 1, "Memcheck sanity test 09 (new/write right).": 1, "Memcheck sanity test 10 (write after free).": 1, "Memcheck sanity test 11 (write after delete).": 1, "Memcheck sanity test 12 (array deleted without []).": 1, "Memcheck sanity test 13 (single element deleted with []).": 1, } SANITY_TEST_SUPPRESSIONS_MAC = { "Memcheck sanity test 01 (memory leak).": 1, "Memcheck sanity test 02 (malloc/read left).": 1, "Memcheck sanity test 03 (malloc/read right).": 1, "Memcheck sanity test 06 (new/read left).": 1, "Memcheck sanity test 07 (new/read right).": 1, "Memcheck sanity test 10 (write after free).": 1, "Memcheck sanity test 11 (write after delete).": 1, "bug_49253 Memcheck sanity test 12 (array deleted without []) on Mac.": 1, "bug_49253 Memcheck sanity test 13 (single element deleted with []) on Mac.": 1, "bug_49253 Memcheck sanity test 04 (malloc/write left) or Memcheck sanity test 05 (malloc/write right) on Mac.": 2, "bug_49253 Memcheck sanity test 08 (new/write left) or Memcheck sanity test 09 (new/write right) on Mac.": 2, } | def find_and_truncate(f): f.seek(0) while True: line = f.readline() if line == "": return False if '</valgrindoutput>' in line: # valgrind often has garbage after </valgrindoutput> upon crash f.truncate() return True | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py |
logging.warn(str(origsize - newsize) + " bytes of junk were after </valgrindoutput> in %s!" % file) | logging.warn(str(origsize - newsize) + " bytes of junk were after </valgrindoutput> in %s!" % file) | def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False): '''Reads in a set of files. | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py |
remaining_sanity_supp = set(MemcheckAnalyze.SANITY_TEST_SUPPRESSIONS) for item in sorted(self._suppcounts.items(), key=lambda (k,v): (v,k)): print "%7s %s" % (item[1], item[0]) if item[0] in remaining_sanity_supp: remaining_sanity_supp.remove(item[0]) | if common.IsLinux(): remaining_sanity_supp = MemcheckAnalyze.SANITY_TEST_SUPPRESSIONS_LINUX elif common.IsMac(): remaining_sanity_supp = MemcheckAnalyze.SANITY_TEST_SUPPRESSIONS_MAC else: remaining_sanity_supp = {} if check_sanity: logging.warn("No sanity test list for platform %s", sys.platform) for (name, count) in sorted(self._suppcounts.items(), key=lambda (k,v): (v,k)): print "%7d %s" % (count, name) if name in remaining_sanity_supp and remaining_sanity_supp[name] == count: del remaining_sanity_supp[name] | def Report(self, check_sanity=False): if self._parse_failed: logging.error("FAIL! Couldn't parse Valgrind output file") return -2 | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py |
for supp in remaining_sanity_supp: logging.info(" " + supp) | for (name, count) in sorted(remaining_sanity_supp.items(), key=lambda (k,v): (v,k)): logging.info("%7d %s" % (count, name)) | def Report(self, check_sanity=False): if self._parse_failed: logging.error("FAIL! Couldn't parse Valgrind output file") return -2 | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py |
else: if start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') | def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif self.IsMac(): pass else: # windows if start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') | f8f2eac7aa00ef3eac8237a6e3501152d70c7018 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f8f2eac7aa00ef3eac8237a6e3501152d70c7018/coverage_posix.py |
|
"""Checks that the user didn't paste 'Suppression:' into the file""" keyword = 'Suppression:' | """Checks the memcheck suppressions files for bad data.""" errors = [] skip_next_line = False func_re = input_api.re.compile('[a-z_.]+\(.+\)$') | def CheckChange(input_api, output_api): """Checks that the user didn't paste 'Suppression:' into the file""" keyword = 'Suppression:' for f, line_num, line in input_api.RightHandSideLines(lambda x: x.LocalPath().endswith('.txt')): if keyword in line: text = '"%s" must not be included; %s line %s' % ( keyword, f.LocalPath(), line_num) return [output_api.PresubmitError(text)] return [] | 979738a04212dc1bf0287b01c59fd6e6adacdf76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/979738a04212dc1bf0287b01c59fd6e6adacdf76/PRESUBMIT.py |
if keyword in line: text = '"%s" must not be included; %s line %s' % ( keyword, f.LocalPath(), line_num) return [output_api.PresubmitError(text)] | line = line.lstrip() if line.startswith(' continue if skip_next_line: skip_next_line = False continue if (line.startswith('fun:') or line.startswith('obj:') or line.startswith('Memcheck:') or line == '}' or line == '...'): continue if func_re.match(line): continue if line == '{': skip_next_line = True continue errors.append('"%s" is probably wrong: %s line %s' % (line, f.LocalPath(), line_num)) if errors: return [output_api.PresubmitError('\n'.join(errors))] | def CheckChange(input_api, output_api): """Checks that the user didn't paste 'Suppression:' into the file""" keyword = 'Suppression:' for f, line_num, line in input_api.RightHandSideLines(lambda x: x.LocalPath().endswith('.txt')): if keyword in line: text = '"%s" must not be included; %s line %s' % ( keyword, f.LocalPath(), line_num) return [output_api.PresubmitError(text)] return [] | 979738a04212dc1bf0287b01c59fd6e6adacdf76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/979738a04212dc1bf0287b01c59fd6e6adacdf76/PRESUBMIT.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); | GLsizei num_values = 0; GetNumValuesReturnedForGLGet(pname, &num_values); | code = """ typedef %(func_name)s::Result Result; | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | typedef %(name)s::Result Result; | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(false); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
SpecializedSetup<%(name)s, 0>(); | SpecializedSetup<%(name)s, 0>(true); | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c09b66fa6c9b1cbe85cad7ac28eacb107f5b988d/build_gles2_cmd_buffer.py |
'win': '_pyautolib.dll', | 'win': '_pyautolib.pyd', | def _ParseArgs(self): parser = optparse.OptionParser() parser.add_option( '-d', '--outdir', type='string', default=None, help='Directory in which to setup. This is typically the directory ' 'where the binaries would go when compiled from source.') parser.add_option( '-p', '--platform', type='string', default=pyauto_utils.GetCurrentPlatform(), help='Platform. Valid options: win, mac, linux32, linux64. ' 'Default: current platform (%s)' % pyauto_utils.GetCurrentPlatform()) self._options, self._args = parser.parse_args() if not self._options.outdir: print >>sys.stderr, 'Need output directory: -d/--outdir' sys.exit(1) if not self._args: print >>sys.stderr, 'Need download url' sys.exit(2) self._outdir = self._options.outdir self._url = self._args[0] | 5de24749b98e07ca2b74a0ede07a6223d31ea582 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5de24749b98e07ca2b74a0ede07a6223d31ea582/fetch_prebuilt_pyauto.py |
'win': '_pyautolib.dll' | 'win': '_pyautolib.pyd' | def Run(self): self._ParseArgs() if not os.path.isdir(self._outdir): os.makedirs(self._outdir) | 5de24749b98e07ca2b74a0ede07a6223d31ea582 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5de24749b98e07ca2b74a0ede07a6223d31ea582/fetch_prebuilt_pyauto.py |
if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TOOLS_PATH]/python ' + '"' + sys.argv[0] + '" ' + ' '.join(sys.argv[1:])) | def main(): if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TOOLS_PATH]/python ' + '"' + sys.argv[0] + '" ' + ' '.join(sys.argv[1:])) cmd = [sys.executable] src_dir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(sys.argv[0])))))) script_dir=os.path.join(src_dir, "third_party", "WebKit", "WebKitTools", "Scripts") script = os.path.join(script_dir, 'new-run-webkit-tests') cmd.append(script) if '--chromium' not in sys.argv: cmd.append('--chromium') cmd.extend(sys.argv[1:]) return subprocess.call(cmd) | d616dc6436b62c19e9499cb3e9c4a7c765558d76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d616dc6436b62c19e9499cb3e9c4a7c765558d76/run_webkit_tests.py |
|
os.path.dirname(os.path.abspath(sys.argv[0])))))) | os.path.dirname(src_dir))))) | def main(): if sys.platform == 'cygwin': return( 'ERROR: you are running from cygwin python, which is not\n' ' supported by "run_webkit_test.py". You should use python\n' ' for Windows (2.5+) to launch this script. A python for\n' ' Windows can be found at your depot_tools folder:\n' ' [DEPOT_TOOLS_PATH]/python ' + '"' + sys.argv[0] + '" ' + ' '.join(sys.argv[1:])) cmd = [sys.executable] src_dir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(sys.argv[0])))))) script_dir=os.path.join(src_dir, "third_party", "WebKit", "WebKitTools", "Scripts") script = os.path.join(script_dir, 'new-run-webkit-tests') cmd.append(script) if '--chromium' not in sys.argv: cmd.append('--chromium') cmd.extend(sys.argv[1:]) return subprocess.call(cmd) | d616dc6436b62c19e9499cb3e9c4a7c765558d76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/d616dc6436b62c19e9499cb3e9c4a7c765558d76/run_webkit_tests.py |
file.Write(""" scoped_refptr<PPB_Graphics3D_Impl> graphics_3d = | file.Write(""" scoped_refptr<PPB_Graphics3D_Impl> graphics_3d = | def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation.""" | 52bda661751b08651d3dde4190d4b0b13061bb78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/52bda661751b08651d3dde4190d4b0b13061bb78/build_gles2_cmd_buffer.py |
test_dir = os.path.abspath('.') file_path = os.path.join(test_dir, 'downloads.py') | file_path = self._GetDangerousDownload() | def testDownloadDangerousFiles(self): """Verify that we can download and save dangerous files.""" test_dir = os.path.abspath('.') # This file is a .py file which is "dangerous" file_path = os.path.join(test_dir, 'downloads.py') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'downloads.py') os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | bbf67c9db69a2f951abebd68c32796706587a7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bbf67c9db69a2f951abebd68c32796706587a7e2/downloads.py |
'downloads.py') | os.path.basename(file_path)) | def testDownloadDangerousFiles(self): """Verify that we can download and save dangerous files.""" test_dir = os.path.abspath('.') # This file is a .py file which is "dangerous" file_path = os.path.join(test_dir, 'downloads.py') file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 'downloads.py') os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) | bbf67c9db69a2f951abebd68c32796706587a7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bbf67c9db69a2f951abebd68c32796706587a7e2/downloads.py |
def RenderPages(names, test_shell): | def RenderPage(name, test_shell): | def RenderPages(names, test_shell): """ Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html """ if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) # Start with a fresh copy of page shell for each file. # Save the current contents so that we can look for changes later. originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) # The remaining output will be the content of the generated pages. output = p.stdout.read() # Parse out just the JSON part. begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Remove page_shell input_file = _base_dir + "/" + name + ".html" os.remove(input_file) # Write output open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html | Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html | def RenderPages(names, test_shell): """ Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html """ if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) # Start with a fresh copy of page shell for each file. # Save the current contents so that we can look for changes later. originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) # The remaining output will be the content of the generated pages. output = p.stdout.read() # Parse out just the JSON part. begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Remove page_shell input_file = _base_dir + "/" + name + ".html" os.remove(input_file) # Write output open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) | if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) | def RenderPages(names, test_shell): """ Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html """ if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) # Start with a fresh copy of page shell for each file. # Save the current contents so that we can look for changes later. originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) # The remaining output will be the content of the generated pages. output = p.stdout.read() # Parse out just the JSON part. begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Remove page_shell input_file = _base_dir + "/" + name + ".html" os.remove(input_file) # Write output open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], | p = Popen([test_shell, "--layout-tests", generator_url], | def RenderPages(names, test_shell): """ Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html """ if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) # Start with a fresh copy of page shell for each file. # Save the current contents so that we can look for changes later. originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) # The remaining output will be the content of the generated pages. output = p.stdout.read() # Parse out just the JSON part. begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Remove page_shell input_file = _base_dir + "/" + name + ".html" os.remove(input_file) # Write output open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
output = p.stdout.read() begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' result = result.replace('\r', '') input_file = _base_dir + "/" + name + ".html" os.remove(input_file) open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith(" raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" result = result.replace(' os.remove(input_file) result = result.replace('\r', '') open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file | def RenderPages(names, test_shell): """ Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html """ if not names: raise Exception("RenderPage called with empty names param") generator_url = "file:" + urllib.pathname2url(_generator_html) generator_url += "?" + ",".join(names) # Start with a fresh copy of page shell for each file. # Save the current contents so that we can look for changes later. originals = {} for name in names: input_file = _base_dir + "/" + name + ".html" if (os.path.isfile(input_file)): originals[name] = open(input_file, 'rb').read() os.remove(input_file) else: originals[name] = "" shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen( [test_shell, "--layout-tests", "--time-out-ms=30000", generator_url], stdout=PIPE) # The remaining output will be the content of the generated pages. output = p.stdout.read() # Parse out just the JSON part. begin = output.find(_expected_output_preamble) end = output.rfind(_expected_output_postamble) if (begin < 0 or end < 0): raise Exception ("test_shell returned invalid output:\n\n" + output) begin += len(_expected_output_preamble) try: output_parsed = json.loads(output[begin:end]) except ValueError, msg: raise Exception("Could not parse test_shell output as JSON. Error: " + msg + "\n\nOutput was:\n" + output) changed_files = [] for name in names: result = output_parsed[name].encode("utf8") + '\n' # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Remove page_shell input_file = _base_dir + "/" + name + ".html" os.remove(input_file) # Write output open(input_file, 'wb').write(result) if (originals[name] and result != originals[name]): changed_files.append(input_file) return changed_files | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
search_locations.append(chrome_dir + "/Debug/test_shell.exe") | def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
|
search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") | def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
|
search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") | def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
|
raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | raise Exception ("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | def FindTestShell(): # This is hacky. It is used to guess the location of the test_shell chrome_dir = os.path.normpath(_base_dir + "/../../../") src_dir = os.path.normpath(chrome_dir + "/../") search_locations = [] if (sys.platform in ('cygwin', 'win32')): home_dir = os.path.normpath(os.getenv("HOMEDRIVE") + os.getenv("HOMEPATH")) search_locations.append(chrome_dir + "/Release/test_shell.exe") search_locations.append(chrome_dir + "/Debug/test_shell.exe") search_locations.append(home_dir + "/bin/test_shell/" + "test_shell.exe") if (sys.platform in ('linux', 'linux2')): search_locations.append(src_dir + "/sconsbuild/Release/test_shell") search_locations.append(src_dir + "/out/Release/test_shell") search_locations.append(src_dir + "/sconsbuild/Debug/test_shell") search_locations.append(src_dir + "/out/Debug/test_shell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/test_shell") if (sys.platform == 'darwin'): search_locations.append(src_dir + "/xcodebuild/Release/TestShell.app/Contents/MacOS/TestShell") search_locations.append(src_dir + "/xcodebuild/Debug/TestShell.app/Contents/MacOS/TestShell") search_locations.append(os.getenv("HOME") + "/bin/test_shell/" + "TestShell.app/Contents/MacOS/TestShell") for loc in search_locations: if os.path.isfile(loc): return loc raise Exception("Could not find test_shell executable\n" + "**test_shell may need to be built**\n" + "Searched: \n" + "\n".join(search_locations) + "\n" + "To specify a path to test_shell use --test-shell-path") | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
modified_files = RenderPages(page_names, test_shell) | modified_files = [] for page in page_names: modified_file = RenderPage(page, test_shell) if (modified_file): modified_files.append(modified_file) | def main(): # Prevent windows from using cygwin python. if (sys.platform == "cygwin"): raise Exception("Building docs not supported for cygwin python.\n" "Please run the build.bat script.") parser = OptionParser() parser.add_option("--test-shell-path", dest="test_shell_path") (options, args) = parser.parse_args() if (options.test_shell_path and os.path.isfile(options.test_shell_path)): test_shell = options.test_shell_path else: test_shell = FindTestShell() # Read static file names static_names = GetStaticFileNames() # Read module names module_names = GetAPIModuleNames() # All pages to generate page_names = static_names | module_names modified_files = RenderPages(page_names, test_shell) if (len(modified_files) == 0): print "Output files match existing files. No changes made." else: print ("ATTENTION: EXTENSION DOCS HAVE CHANGED\n" + "The following files have been modified and should be checked\n" + "into source control (ideally in the same changelist as the\n" + "underlying files that resulting in their changing).") for f in modified_files: print f # Hack. Sleep here, otherwise windows doesn't properly close the debug.log # and the os.remove will fail with a "Permission denied". time.sleep(1) debug_log = os.path.normpath(_build_dir + "/" + "debug.log") if (os.path.isfile(debug_log)): os.remove(debug_log) return os.EX_OK | 890a7e0412d44722ded596dbde2d11923542d26f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/890a7e0412d44722ded596dbde2d11923542d26f/build.py |
result = unittest.TextTestRunner(verbosity=verbosity).run(pyauto_suite) | result = PyAutoTextTestRuner(verbosity=verbosity).run(pyauto_suite) | def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid()) | 90a7999e5464cc57fa938bb2dc084b395602cdd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/90a7999e5464cc57fa938bb2dc084b395602cdd4/pyauto.py |
last_hash = line[25:33] if last_hash[0] == '-': last_hash = line[26:34] | last_hash = line[25:41] | def ReadReportsFromFile(filename): """ Returns a list of (report_hash, report) and the URL of the report on the waterfall. """ input_file = file(filename, 'r') # reports is a list of (error hash, report) pairs. reports = [] in_suppression = False cur_supp = [] # This stores the last error hash found while reading the file. last_hash = "" for line in input_file: line = line.strip() line = line.replace("</span><span class=\"stdout\">", "") line = line.replace("</span><span class=\"stderr\">", "") line = line.replace("<", "<") line = line.replace(">", ">") if in_suppression: if line == "}": cur_supp += ["}"] reports += [[last_hash, "\n".join(cur_supp)]] in_suppression = False cur_supp = [] last_hash = "" else: cur_supp += [" "*3 + line] elif line == "{": in_suppression = True cur_supp = ["{"] elif line.find("Suppression (error hash=#") == 0: last_hash = line[25:33] # Work around an (fixed) bug in memcheck_analyze.py. # TODO(jochen): delete this after a couple of days. if last_hash[0] == '-': last_hash = line[26:34] # The line at the end of the file is assumed to store the URL of the report. return reports,line | 51d4a0823143be50ba27e2742cc4a1b3f132a276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/51d4a0823143be50ba27e2742cc4a1b3f132a276/test_suppressions.py |
self.NO_SUCH_URL2 = 'http://no_such_url_exists2/' self.NO_SUCH_URL3 = 'http://no_such_url_exists3/' | def __init__(self, methodName='runTest'): super(NotificationsTest, self).__init__(methodName) self.NO_SUCH_URL = 'http://no_such_url_exists/' self.NO_SUCH_URL2 = 'http://no_such_url_exists2/' self.NO_SUCH_URL3 = 'http://no_such_url_exists3/' # Content settings for default notification permission. self.ALLOW_ALL_SETTING = 1 self.DENY_ALL_SETTING = 2 self.ASK_SETTING = 3 | 4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b/notifications.py |
|
self._CreateHTMLNotification(self.NO_SUCH_URL) self._CreateHTMLNotification(self.NO_SUCH_URL2) self._CreateHTMLNotification(self.NO_SUCH_URL3) | self._CreateSimpleNotification('', 'Title1', '') self._CreateSimpleNotification('', 'Title2', '') self._CreateSimpleNotification('', 'Title3', '') | def testNotificationOrderAfterClosingOne(self): """Tests that closing a notification leaves the rest of the notifications in the correct order. """ self._AllowAllOrigins() self.NavigateToURL(self.TEST_PAGE_URL) self._CreateHTMLNotification(self.NO_SUCH_URL) self._CreateHTMLNotification(self.NO_SUCH_URL2) self._CreateHTMLNotification(self.NO_SUCH_URL3) self.assertEquals(3, len(self.GetActiveNotifications())) self.CloseNotification(1) self.assertEquals(2, len(self.GetActiveNotifications())) notifications = self.GetActiveNotifications() self.assertEquals(self.NO_SUCH_URL, notifications[0]['content_url']) self.assertEquals(self.NO_SUCH_URL3, notifications[1]['content_url']) | 4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b/notifications.py |
notifications = self.GetActiveNotifications() self.assertEquals(self.NO_SUCH_URL, notifications[0]['content_url']) self.assertEquals(self.NO_SUCH_URL3, notifications[1]['content_url']) | new_notifications = self.GetActiveNotifications() self.assertEquals(old_notifications[0], new_notifications[0]) self.assertEquals(old_notifications[2], new_notifications[1]) | def testNotificationOrderAfterClosingOne(self): """Tests that closing a notification leaves the rest of the notifications in the correct order. """ self._AllowAllOrigins() self.NavigateToURL(self.TEST_PAGE_URL) self._CreateHTMLNotification(self.NO_SUCH_URL) self._CreateHTMLNotification(self.NO_SUCH_URL2) self._CreateHTMLNotification(self.NO_SUCH_URL3) self.assertEquals(3, len(self.GetActiveNotifications())) self.CloseNotification(1) self.assertEquals(2, len(self.GetActiveNotifications())) notifications = self.GetActiveNotifications() self.assertEquals(self.NO_SUCH_URL, notifications[0]['content_url']) self.assertEquals(self.NO_SUCH_URL3, notifications[1]['content_url']) | 4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4c0d7a02c51b35ffe1d14898aac4fd4e0c87b43b/notifications.py |
path_utils.ChromiumBaselinePath(platform), expected_filename) | path_utils.ChromiumBaselinePath(platform), "LayoutTests", expected_filename) | def _ExtractAndAddNewBaselines(self, archive_file): """Extract new baselines from archive and add them to SVN repository. | f2e0d22b6fc87144be849c2ad18f098c479b7a36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f2e0d22b6fc87144be849c2ad18f098c479b7a36/rebaseline.py |
'', '--ui-test-flags', type='string', default='', help='Flags passed to the UI test suite. Refer ui_test.h for options') | '', '--chrome-flags', type='string', default='', help='Flags passed to Chrome. This is in addition to the usual flags ' 'like suppressing first-run dialogs, enabling automation. ' 'See chrome/common/chrome_switches.cc for the list of flags ' 'chrome understands.') | def _ParseArgs(self): """Parse command line args.""" parser = optparse.OptionParser() parser.add_option( '-v', '--verbose', action='store_true', default=False, help='Make PyAuto verbose.') parser.add_option( '-D', '--wait-for-debugger', action='store_true', default=False, help='Block PyAuto on startup for attaching debugger.') parser.add_option( '', '--ui-test-flags', type='string', default='', help='Flags passed to the UI test suite. Refer ui_test.h for options') parser.add_option( '', '--list-missing-tests', action='store_true', default=False, help='Print a list of tests not included in PYAUTO_TESTS, and exit') parser.add_option( '', '--repeat', type='int', default=1, help='Number of times to repeat the tests. Useful to determine ' 'flakiness. Defaults to 1.') | 73fc19bbbee1239496b1fd0997cc1e769731c075 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/73fc19bbbee1239496b1fd0997cc1e769731c075/pyauto.py |
pyauto_suite = PyUITestSuite(re.split('\s+', self._options.ui_test_flags)) | suite_args = [sys.argv[0]] if self._options.chrome_flags: suite_args.append('--extra-chrome-flags=' + self._options.chrome_flags) pyauto_suite = PyUITestSuite(suite_args) | def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid()) | 73fc19bbbee1239496b1fd0997cc1e769731c075 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/73fc19bbbee1239496b1fd0997cc1e769731c075/pyauto.py |
print path, "OK:", metadata["License File"] print | def ScanThirdPartyDirs(third_party_dirs): """Scan a list of directories and report on any problems we find.""" errors = [] for path in sorted(third_party_dirs): try: metadata = ParseDir(path) except LicenseError, e: errors.append((path, e.args[0])) continue print path, "OK:", metadata["License File"] print for path, error in sorted(errors): print path + ": " + error | 1e83978e26f44269394601a19b3a1d37488b5963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1e83978e26f44269394601a19b3a1d37488b5963/licenses.py |
|
chrome_flags += ' --dom-automation' | def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid()) | 4cfda72eeee0f27b8e7c75e6bf509c8b14fc803c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/4cfda72eeee0f27b8e7c75e6bf509c8b14fc803c/pyauto.py |
|
if func.GetInfo('needs_size'): | if func.GetInfo('needs_size') and not func.name.endswith('Bucket'): | def InitFunction(self, func): """Add or adjust anything type specific for this function.""" if func.GetInfo('needs_size'): func.AddCmdArg(DataSizeArgument('data_size')) | 2297c9a1cce6c17803191d6b953d360c43fc8d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2297c9a1cce6c17803191d6b953d360c43fc8d75/build_gles2_cmd_buffer.py |
return self | return BucketPointerArgument(self.name, self.type) | def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return self | 2297c9a1cce6c17803191d6b953d360c43fc8d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2297c9a1cce6c17803191d6b953d360c43fc8d75/build_gles2_cmd_buffer.py |
def InitFunction(self): """Overridden from Function""" pass | def InitFunction(self): """Overridden from Function""" pass | 2297c9a1cce6c17803191d6b953d360c43fc8d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2297c9a1cce6c17803191d6b953d360c43fc8d75/build_gles2_cmd_buffer.py |
|
pass | self.type_handler.WriteBucketServiceImplementation(self, file) | def WriteServiceImplementation(self, file): """Overridden from Function""" pass | 2297c9a1cce6c17803191d6b953d360c43fc8d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2297c9a1cce6c17803191d6b953d360c43fc8d75/build_gles2_cmd_buffer.py |
def RunCommand(argv): """Runs the command with given argv and returns exit code.""" try: proc = subprocess.Popen(argv, stdout=None) except OSError: return 1 output = proc.communicate()[0] return proc.returncode | NONESSENTIAL_DIRS = ( 'chrome/test/data', 'chrome/tools/test/reference_build', 'gears/binaries', 'net/data/cache_tests', 'o3d/documentation', 'o3d/samples', 'third_party/lighttpd', 'third_party/WebKit/LayoutTests', 'webkit/data/layout_tests', 'webkit/tools/test/reference_build', ) def GetSourceDirectory(): return os.path.realpath( os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src')) | def RunCommand(argv): """Runs the command with given argv and returns exit code.""" try: proc = subprocess.Popen(argv, stdout=None) except OSError: return 1 output = proc.communicate()[0] return proc.returncode | c587aa3ec7473e2303e8ccbf4eb2d3361f87f121 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c587aa3ec7473e2303e8ccbf4eb2d3361f87f121/export_tarball.py |
target_dir = tempfile.mkdtemp() | def main(argv): parser = optparse.OptionParser() parser.add_option("--remove-nonessential-files", dest="remove_nonessential_files", action="store_true", default=False) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: output file name' print '(without .tar.bz2 extension).' return 1 output_fullname = args[0] + '.tar.bz2' output_basename = os.path.basename(args[0]) target_dir = tempfile.mkdtemp() try: if RunCommand(['gclient', 'export', target_dir]) != 0: print 'gclient failed' return 1 if options.remove_nonessential_files: nonessential_dirs = ( 'src/chrome/test/data', 'src/chrome/tools/test/reference_build', 'src/gears/binaries', 'src/net/data/cache_tests', 'src/o3d/documentation', 'src/o3d/samples', 'src/third_party/lighttpd', 'src/third_party/WebKit/LayoutTests', 'src/webkit/data/layout_tests', 'src/webkit/tools/test/reference_build', ) for dir in nonessential_dirs: path = os.path.join(target_dir, dir) try: print 'removing %s...' % dir shutil.rmtree(path) except OSError, e: print 'error while trying to remove %s, skipping' % dir with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(os.path.join(target_dir, 'src'), arcname=output_basename) finally: shutil.rmtree(target_dir) return 0 | c587aa3ec7473e2303e8ccbf4eb2d3361f87f121 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c587aa3ec7473e2303e8ccbf4eb2d3361f87f121/export_tarball.py |
|
try: if RunCommand(['gclient', 'export', target_dir]) != 0: print 'gclient failed' return 1 | def ShouldExcludePath(path): head, tail = os.path.split(path) if tail in ('.svn', '.git'): return True | def main(argv): parser = optparse.OptionParser() parser.add_option("--remove-nonessential-files", dest="remove_nonessential_files", action="store_true", default=False) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: output file name' print '(without .tar.bz2 extension).' return 1 output_fullname = args[0] + '.tar.bz2' output_basename = os.path.basename(args[0]) target_dir = tempfile.mkdtemp() try: if RunCommand(['gclient', 'export', target_dir]) != 0: print 'gclient failed' return 1 if options.remove_nonessential_files: nonessential_dirs = ( 'src/chrome/test/data', 'src/chrome/tools/test/reference_build', 'src/gears/binaries', 'src/net/data/cache_tests', 'src/o3d/documentation', 'src/o3d/samples', 'src/third_party/lighttpd', 'src/third_party/WebKit/LayoutTests', 'src/webkit/data/layout_tests', 'src/webkit/tools/test/reference_build', ) for dir in nonessential_dirs: path = os.path.join(target_dir, dir) try: print 'removing %s...' % dir shutil.rmtree(path) except OSError, e: print 'error while trying to remove %s, skipping' % dir with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(os.path.join(target_dir, 'src'), arcname=output_basename) finally: shutil.rmtree(target_dir) return 0 | c587aa3ec7473e2303e8ccbf4eb2d3361f87f121 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c587aa3ec7473e2303e8ccbf4eb2d3361f87f121/export_tarball.py |
if options.remove_nonessential_files: nonessential_dirs = ( 'src/chrome/test/data', 'src/chrome/tools/test/reference_build', 'src/gears/binaries', 'src/net/data/cache_tests', 'src/o3d/documentation', 'src/o3d/samples', 'src/third_party/lighttpd', 'src/third_party/WebKit/LayoutTests', 'src/webkit/data/layout_tests', 'src/webkit/tools/test/reference_build', ) for dir in nonessential_dirs: path = os.path.join(target_dir, dir) try: print 'removing %s...' % dir shutil.rmtree(path) except OSError, e: print 'error while trying to remove %s, skipping' % dir | if not options.remove_nonessential_files: return False for nonessential_dir in NONESSENTIAL_DIRS: if path.startswith(os.path.join(GetSourceDirectory(), nonessential_dir)): return True | def main(argv): parser = optparse.OptionParser() parser.add_option("--remove-nonessential-files", dest="remove_nonessential_files", action="store_true", default=False) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: output file name' print '(without .tar.bz2 extension).' return 1 output_fullname = args[0] + '.tar.bz2' output_basename = os.path.basename(args[0]) target_dir = tempfile.mkdtemp() try: if RunCommand(['gclient', 'export', target_dir]) != 0: print 'gclient failed' return 1 if options.remove_nonessential_files: nonessential_dirs = ( 'src/chrome/test/data', 'src/chrome/tools/test/reference_build', 'src/gears/binaries', 'src/net/data/cache_tests', 'src/o3d/documentation', 'src/o3d/samples', 'src/third_party/lighttpd', 'src/third_party/WebKit/LayoutTests', 'src/webkit/data/layout_tests', 'src/webkit/tools/test/reference_build', ) for dir in nonessential_dirs: path = os.path.join(target_dir, dir) try: print 'removing %s...' % dir shutil.rmtree(path) except OSError, e: print 'error while trying to remove %s, skipping' % dir with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(os.path.join(target_dir, 'src'), arcname=output_basename) finally: shutil.rmtree(target_dir) return 0 | c587aa3ec7473e2303e8ccbf4eb2d3361f87f121 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c587aa3ec7473e2303e8ccbf4eb2d3361f87f121/export_tarball.py |
with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(os.path.join(target_dir, 'src'), arcname=output_basename) finally: shutil.rmtree(target_dir) | return False with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(GetSourceDirectory(), arcname=output_basename, exclude=ShouldExcludePath) | def main(argv): parser = optparse.OptionParser() parser.add_option("--remove-nonessential-files", dest="remove_nonessential_files", action="store_true", default=False) options, args = parser.parse_args(argv) if len(args) != 1: print 'You must provide only one argument: output file name' print '(without .tar.bz2 extension).' return 1 output_fullname = args[0] + '.tar.bz2' output_basename = os.path.basename(args[0]) target_dir = tempfile.mkdtemp() try: if RunCommand(['gclient', 'export', target_dir]) != 0: print 'gclient failed' return 1 if options.remove_nonessential_files: nonessential_dirs = ( 'src/chrome/test/data', 'src/chrome/tools/test/reference_build', 'src/gears/binaries', 'src/net/data/cache_tests', 'src/o3d/documentation', 'src/o3d/samples', 'src/third_party/lighttpd', 'src/third_party/WebKit/LayoutTests', 'src/webkit/data/layout_tests', 'src/webkit/tools/test/reference_build', ) for dir in nonessential_dirs: path = os.path.join(target_dir, dir) try: print 'removing %s...' % dir shutil.rmtree(path) except OSError, e: print 'error while trying to remove %s, skipping' % dir with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: archive.add(os.path.join(target_dir, 'src'), arcname=output_basename) finally: shutil.rmtree(target_dir) return 0 | c587aa3ec7473e2303e8ccbf4eb2d3361f87f121 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/c587aa3ec7473e2303e8ccbf4eb2d3361f87f121/export_tarball.py |
class StringPrinter: | class StringPrinter(object): | def ustring_to_string(ptr, length=None): """Convert a pointer to UTF-16 data into a Python Unicode string. ptr and length are both gdb.Value objects. If length is unspecified, will guess at the length.""" extra = '' if length is None: # Try to guess at the length. for i in xrange(0, 2048): if int((ptr + i).dereference()) == 0: length = i break if length is None: length = 256 extra = u' (no trailing NUL found)' else: length = int(length) char_vals = [int((ptr + i).dereference()) for i in xrange(length)] string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace') return string + extra | 2c088d8838ab3f7fd2e6246139f6f9366c149b36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2c088d8838ab3f7fd2e6246139f6f9366c149b36/webkit.py |
code = """%(return_type)s %(name)s(%(typed_args)s) { if (%(count_name)s < 0) { SetGLError(GL_INVALID_VALUE, "gl%(name)s: n < 0"); return; } %(resource_type)s_id_handler_->MakeIds(0, %(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % { | args = { | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { | dd338377948baa4520f90f4c2447926216be4728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/dd338377948baa4520f90f4c2447926216be4728/build_gles2_cmd_buffer.py |
}) | } file.Write("%(return_type)s %(name)s(%(typed_args)s) {\n" % args) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file, func) code = """ %(resource_type)s_id_handler_->MakeIds(0, %(args)s); helper_->%(name)sImmediate(%(args)s); } """ file.Write(code % args) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) { | dd338377948baa4520f90f4c2447926216be4728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/dd338377948baa4520f90f4c2447926216be4728/build_gles2_cmd_buffer.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.