Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: tools/presubmit.py

Issue 83353002: Exclude benchmark tests from presubmit check in a non-git checkout. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 def Run(self, path): 185 def Run(self, path):
186 all_files = [] 186 all_files = []
187 for file in self.GetPathsToSearch(): 187 for file in self.GetPathsToSearch():
188 all_files += self.FindFilesIn(join(path, file)) 188 all_files += self.FindFilesIn(join(path, file))
189 if not self.ProcessFiles(all_files, path): 189 if not self.ProcessFiles(all_files, path):
190 return False 190 return False
191 return True 191 return True
192 192
193 def IgnoreDir(self, name): 193 def IgnoreDir(self, name):
194 return name.startswith('.') or name == 'data' or name == 'sputniktests' 194 return (name.startswith('.') or
195 name == 'data' or
Jakob Kummerow 2013/11/22 12:18:23 shorter: name in ('data', 'kraken', 'octane', 'sun
196 name == 'kraken' or
197 name == 'sunspider' or
198 name == 'octane')
195 199
196 def IgnoreFile(self, name): 200 def IgnoreFile(self, name):
197 return name.startswith('.') 201 return name.startswith('.')
198 202
199 def FindFilesIn(self, path): 203 def FindFilesIn(self, path):
200 result = [] 204 result = []
201 for (root, dirs, files) in os.walk(path): 205 for (root, dirs, files) in os.walk(path):
202 for ignored in [x for x in dirs if self.IgnoreDir(x)]: 206 for ignored in [x for x in dirs if self.IgnoreDir(x)]:
203 dirs.remove(ignored) 207 dirs.remove(ignored)
204 for file in files: 208 for file in files:
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "two empty lines between declarations check..." 430 "two empty lines between declarations check..."
427 success = SourceProcessor().Run(workspace) and success 431 success = SourceProcessor().Run(workspace) and success
428 if success: 432 if success:
429 return 0 433 return 0
430 else: 434 else:
431 return 1 435 return 1
432 436
433 437
434 if __name__ == '__main__': 438 if __name__ == '__main__':
435 sys.exit(Main()) 439 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698