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

Side by Side Diff: tools/presubmit.py

Issue 439863004: Initial import of unittests using GTest/GMock. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 6 years, 4 months 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 | « testing/gtest.gyp ('k') | tools/run-tests.py » ('j') | 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 whitespace/indent 94 whitespace/indent
95 whitespace/labels 95 whitespace/labels
96 whitespace/line_length 96 whitespace/line_length
97 whitespace/newline 97 whitespace/newline
98 whitespace/operators 98 whitespace/operators
99 whitespace/parens 99 whitespace/parens
100 whitespace/tab 100 whitespace/tab
101 whitespace/todo 101 whitespace/todo
102 """.split() 102 """.split()
103 103
104 # TODO(bmeurer): Fix and re-enable readability/check 104 #TODO(bmeurer) : Fix and re - enable readability / check
105 105
106 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') 106 LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing')
107 107
108 108
109 def CppLintWorker(command): 109 def CppLintWorker(command):
110 try: 110 try:
111 process = subprocess.Popen(command, stderr=subprocess.PIPE) 111 process = subprocess.Popen(command, stderr=subprocess.PIPE)
112 process.wait() 112 process.wait()
113 out_lines = "" 113 out_lines = ""
114 error_count = -1 114 error_count = -1
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return (super(CppLintProcessor, self).IgnoreDir(name) 229 return (super(CppLintProcessor, self).IgnoreDir(name)
230 or (name == 'third_party')) 230 or (name == 'third_party'))
231 231
232 IGNORE_LINT = ['flag-definitions.h'] 232 IGNORE_LINT = ['flag-definitions.h']
233 233
234 def IgnoreFile(self, name): 234 def IgnoreFile(self, name):
235 return (super(CppLintProcessor, self).IgnoreFile(name) 235 return (super(CppLintProcessor, self).IgnoreFile(name)
236 or (name in CppLintProcessor.IGNORE_LINT)) 236 or (name in CppLintProcessor.IGNORE_LINT))
237 237
238 def GetPathsToSearch(self): 238 def GetPathsToSearch(self):
239 return ['src', 'include', 'samples', join('test', 'cctest')] 239 return ['src', 'include', 'samples', join('test', 'cctest'),
240 join('test', 'unittests')]
240 241
241 def GetCpplintScript(self, prio_path): 242 def GetCpplintScript(self, prio_path):
242 for path in [prio_path] + os.environ["PATH"].split(os.pathsep): 243 for path in [prio_path] + os.environ["PATH"].split(os.pathsep):
243 path = path.strip('"') 244 path = path.strip('"')
244 cpplint = os.path.join(path, "cpplint.py") 245 cpplint = os.path.join(path, "cpplint.py")
245 if os.path.isfile(cpplint): 246 if os.path.isfile(cpplint):
246 return cpplint 247 return cpplint
247 248
248 return None 249 return None
249 250
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 success = SourceProcessor().Run(workspace) and success 445 success = SourceProcessor().Run(workspace) and success
445 success = CheckGeneratedRuntimeTests(workspace) and success 446 success = CheckGeneratedRuntimeTests(workspace) and success
446 if success: 447 if success:
447 return 0 448 return 0
448 else: 449 else:
449 return 1 450 return 1
450 451
451 452
452 if __name__ == '__main__': 453 if __name__ == '__main__':
453 sys.exit(Main()) 454 sys.exit(Main())
OLDNEW
« no previous file with comments | « testing/gtest.gyp ('k') | tools/run-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698