blob: fd078e389ec375eb7f31386b44748fb34ef6cbe7 [file] [log] [blame]
epogerb1442712014-06-05 10:30:37 -07001#!/usr/bin/python
2
Eric Borena1db7992021-03-25 09:04:43 -04003
epogerb1442712014-06-05 10:30:37 -07004"""
5Copyright 2014 Google Inc.
6
7Use of this source code is governed by a BSD-style license that can be
8found in the LICENSE file.
9
10Run all unittests within this directory tree, recursing into subdirectories.
11"""
12
Eric Borena1db7992021-03-25 09:04:43 -040013
14from __future__ import print_function
epogerb1442712014-06-05 10:30:37 -070015import os
16import unittest
17
epogerb1442712014-06-05 10:30:37 -070018
19def main():
epogerb1442712014-06-05 10:30:37 -070020 suite = unittest.TestLoader().discover(os.path.dirname(__file__),
21 pattern='*_test.py')
22 results = unittest.TextTestRunner(verbosity=2).run(suite)
Eric Borena1db7992021-03-25 09:04:43 -040023 print(repr(results))
epogerb1442712014-06-05 10:30:37 -070024 if not results.wasSuccessful():
25 raise Exception('failed one or more unittests')
26
Eric Borena1db7992021-03-25 09:04:43 -040027
epogerb1442712014-06-05 10:30:37 -070028if __name__ == '__main__':
29 main()