189335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org#!/usr/bin/python
289335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org
389335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org# Copyright 2014 Google Inc.
489335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org#
589335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org# Use of this source code is governed by a BSD-style license that can be
689335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org# found in the LICENSE file.
789335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org
889335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org"""
989335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.orgRun all the tests in platform_tools/android/tests.
1089335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org"""
1189335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org
1289335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.orgimport os
1389335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.orgimport unittest
1489335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org
1589335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.orgdef main():
1689335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org  suite = unittest.TestLoader().discover(os.path.dirname(__file__),
1789335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org                                         pattern='*_tests.py')
1889335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org  results = unittest.TextTestRunner(verbosity=2).run(suite)
1989335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org  print repr(results)
2089335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org  if not results.wasSuccessful():
2189335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org    raise Exception('failed one or more unittests')
2289335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org
2389335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.orgif __name__ == '__main__':
2489335631749b29ea92e55ed710f030692aa13297commit-bot@chromium.org  main()
25