1*c8dee2aaSAndroid Build Coastguard Worker#!/usr/bin/python 2*c8dee2aaSAndroid Build Coastguard Worker 3*c8dee2aaSAndroid Build Coastguard Worker 4*c8dee2aaSAndroid Build Coastguard Worker""" 5*c8dee2aaSAndroid Build Coastguard WorkerCopyright 2014 Google Inc. 6*c8dee2aaSAndroid Build Coastguard Worker 7*c8dee2aaSAndroid Build Coastguard WorkerUse of this source code is governed by a BSD-style license that can be 8*c8dee2aaSAndroid Build Coastguard Workerfound in the LICENSE file. 9*c8dee2aaSAndroid Build Coastguard Worker 10*c8dee2aaSAndroid Build Coastguard WorkerRun all unittests within this directory tree, recursing into subdirectories. 11*c8dee2aaSAndroid Build Coastguard Worker""" 12*c8dee2aaSAndroid Build Coastguard Worker 13*c8dee2aaSAndroid Build Coastguard Worker 14*c8dee2aaSAndroid Build Coastguard Workerfrom __future__ import print_function 15*c8dee2aaSAndroid Build Coastguard Workerimport os 16*c8dee2aaSAndroid Build Coastguard Workerimport unittest 17*c8dee2aaSAndroid Build Coastguard Worker 18*c8dee2aaSAndroid Build Coastguard Worker 19*c8dee2aaSAndroid Build Coastguard Workerdef main(): 20*c8dee2aaSAndroid Build Coastguard Worker suite = unittest.TestLoader().discover(os.path.dirname(__file__), 21*c8dee2aaSAndroid Build Coastguard Worker pattern='*_test.py') 22*c8dee2aaSAndroid Build Coastguard Worker results = unittest.TextTestRunner(verbosity=2).run(suite) 23*c8dee2aaSAndroid Build Coastguard Worker print(repr(results)) 24*c8dee2aaSAndroid Build Coastguard Worker if not results.wasSuccessful(): 25*c8dee2aaSAndroid Build Coastguard Worker raise Exception('failed one or more unittests') 26*c8dee2aaSAndroid Build Coastguard Worker 27*c8dee2aaSAndroid Build Coastguard Worker 28*c8dee2aaSAndroid Build Coastguard Workerif __name__ == '__main__': 29*c8dee2aaSAndroid Build Coastguard Worker main() 30