2014-06-05 17:30:37 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2021-03-25 13:04:43 +00:00
|
|
|
|
2014-06-05 17:30:37 +00:00
|
|
|
"""
|
|
|
|
Copyright 2014 Google Inc.
|
|
|
|
|
|
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
|
|
found in the LICENSE file.
|
|
|
|
|
|
|
|
Run all unittests within this directory tree, recursing into subdirectories.
|
|
|
|
"""
|
|
|
|
|
2021-03-25 13:04:43 +00:00
|
|
|
|
|
|
|
from __future__ import print_function
|
2014-06-05 17:30:37 +00:00
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
suite = unittest.TestLoader().discover(os.path.dirname(__file__),
|
|
|
|
pattern='*_test.py')
|
|
|
|
results = unittest.TextTestRunner(verbosity=2).run(suite)
|
2021-03-25 13:04:43 +00:00
|
|
|
print(repr(results))
|
2014-06-05 17:30:37 +00:00
|
|
|
if not results.wasSuccessful():
|
|
|
|
raise Exception('failed one or more unittests')
|
|
|
|
|
2021-03-25 13:04:43 +00:00
|
|
|
|
2014-06-05 17:30:37 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|