Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: build/android/python_test_runner.py

Issue 660023002: [Android] Test runner for python unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: + copyright header Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import argparse
6 import os
7 import sys
8 import unittest
9
10 from pylib import constants
11
12 PYTHON_UNIT_TESTS = {
13 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android'): [
14 'pylib.device.device_utils_test',
15 ],
16 # TODO(mkosiba): Reenable after fixing these.
klundberg 2014/10/16 17:50:15 This seems a bit weird in a new file (the "reenabl
jbudorick 2014/10/16 17:55:07 Hah, no. This CL was motivated by an offline conve
17 # os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp'): [
18 # 'java_cpp_enum_tests'
19 # ]
20 }
21
22
23 def main():
24
25 parser = argparse.ArgumentParser()
26 parser.add_argument('-v', '--verbose', action='count')
27 args = parser.parse_args()
28
29 passed = True
30
31 for path, modules in PYTHON_UNIT_TESTS.iteritems():
32 sys.path = [path] + sys.path
33 try:
34 suite = unittest.TestSuite()
35 suite.addTests(unittest.defaultTestLoader.loadTestsFromName(m)
36 for m in modules)
37 runner = unittest.TextTestRunner(verbosity=args.verbose)
38 passed = (runner.run(suite).wasSuccessful()
39 and passed)
40 finally:
41 sys.path = sys.path[1:]
42
43 return 0 if passed else 1
44
45
46 if __name__ == '__main__':
47 sys.exit(main())
48
OLDNEW
« build/android/buildbot/bb_device_steps.py ('K') | « build/android/buildbot/bb_run_bot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698