OLD | NEW |
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 print "Total violating files: %s" % violations | 356 print "Total violating files: %s" % violations |
357 return success | 357 return success |
358 | 358 |
359 | 359 |
360 def GetOptions(): | 360 def GetOptions(): |
361 result = optparse.OptionParser() | 361 result = optparse.OptionParser() |
362 result.add_option('--no-lint', help="Do not run cpplint", default=False, | 362 result.add_option('--no-lint', help="Do not run cpplint", default=False, |
363 action="store_true") | 363 action="store_true") |
364 return result | 364 return result |
365 | 365 |
| 366 def CheckStaticInitializers(workspace): |
| 367 if os.name != "posix": |
| 368 return True # Non-POSIX not supported yet. |
| 369 return subprocess.call( |
| 370 [ workspace + "/tools/check-static-initializers.sh" ]) == 0 |
366 | 371 |
367 def Main(): | 372 def Main(): |
368 workspace = abspath(join(dirname(sys.argv[0]), '..')) | 373 workspace = abspath(join(dirname(sys.argv[0]), '..')) |
369 parser = GetOptions() | 374 parser = GetOptions() |
370 (options, args) = parser.parse_args() | 375 (options, args) = parser.parse_args() |
371 success = True | 376 success = True |
372 print "Running C++ lint check..." | 377 print "Running C++ lint check..." |
373 if not options.no_lint: | 378 if not options.no_lint: |
374 success = CppLintProcessor().Run(workspace) and success | 379 success = CppLintProcessor().Run(workspace) and success |
375 print "Running copyright header and trailing whitespaces check..." | 380 print "Running copyright header and trailing whitespaces check..." |
376 success = SourceProcessor().Run(workspace) and success | 381 success = SourceProcessor().Run(workspace) and success |
| 382 print "Running static initializers check..." |
| 383 success = CheckStaticInitializers(workspace) and success |
377 if success: | 384 if success: |
378 return 0 | 385 return 0 |
379 else: | 386 else: |
380 return 1 | 387 return 1 |
381 | 388 |
382 | 389 |
383 if __name__ == '__main__': | 390 if __name__ == '__main__': |
384 sys.exit(Main()) | 391 sys.exit(Main()) |
OLD | NEW |