commit-bot@chromium.org | 2a78e82 | 2014-01-06 18:33:19 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | """ |
| 4 | Copyright 2014 Google Inc. |
| 5 | |
| 6 | Use of this source code is governed by a BSD-style license that can be |
| 7 | found in the LICENSE file. |
| 8 | |
| 9 | Run all unittests within this directory tree, recursing into subdirectories. |
| 10 | |
| 11 | TODO(epoger): Launch this automatically on the housekeeper bot, but first make |
| 12 | sure it works properly after having been checked out (from both git and svn) |
| 13 | """ |
| 14 | |
| 15 | import os |
| 16 | import unittest |
| 17 | |
| 18 | |
| 19 | def main(): |
| 20 | suite = unittest.TestLoader().discover(os.path.dirname(__file__), |
| 21 | pattern='*_test.py') |
commit-bot@chromium.org | dd10e0e | 2014-01-24 18:28:35 +0000 | [diff] [blame] | 22 | results = unittest.TextTestRunner(verbosity=2).run(suite) |
| 23 | print repr(results) |
| 24 | if not results.wasSuccessful(): |
| 25 | raise Exception('failed one or more unittests') |
commit-bot@chromium.org | 2a78e82 | 2014-01-06 18:33:19 +0000 | [diff] [blame] | 26 | |
| 27 | if __name__ == '__main__': |
| 28 | main() |