OLD | NEW |
(Empty) | |
| 1 #!/bin/python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import optparse |
| 7 import os |
| 8 import sys |
| 9 import unittest |
| 10 |
| 11 |
| 12 # TODO(dpranke): crbug.com/364709 . We should add the ability to return |
| 13 # JSONified results data for the bots. |
| 14 |
| 15 |
| 16 def main(): |
| 17 parser = optparse.OptionParser() |
| 18 parser.add_option('-v', '--verbose', action='count', default=0) |
| 19 options, args = parser.parse_args() |
| 20 if args: |
| 21 parser.usage() |
| 22 return 1 |
| 23 |
| 24 chromium_src_dir = os.path.join(os.path.dirname(__file__), |
| 25 os.pardir, |
| 26 os.pardir) |
| 27 |
| 28 loader = unittest.loader.TestLoader() |
| 29 print "Running Python unit tests under mojo/public/tools/bindings/pylib ..." |
| 30 suite = loader.discover(os.path.join(chromium_src_dir, 'mojo', 'public', |
| 31 'tools', 'bindings', 'pylib'), |
| 32 pattern='*_unittest.py') |
| 33 |
| 34 runner = unittest.runner.TextTestRunner(verbosity=(options.verbose+1)) |
| 35 result = runner.run(suite) |
| 36 return 0 if result.wasSuccessful() else 1 |
| 37 |
| 38 |
| 39 if __name__ == '__main__': |
| 40 sys.exit(main()) |
OLD | NEW |