OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Runs the Python tests (relies on using the Java test runner).""" | 5 """Runs the Python tests (relies on using the Java test runner).""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 import types | 10 import types |
11 | 11 |
12 import android_commands | 12 from pylib import android_commands |
13 import apk_info | 13 from pylib import constants |
14 import constants | 14 from pylib.instrumentation import apk_info |
| 15 from pylib.instrumentation import run_java_tests |
| 16 from pylib.instrumentation.run_java_tests import FatalTestException |
| 17 from pylib.test_result import TestResults |
| 18 |
15 import python_test_base | 19 import python_test_base |
16 from python_test_caller import CallPythonTest | 20 from python_test_caller import CallPythonTest |
17 from python_test_sharder import PythonTestSharder | 21 from python_test_sharder import PythonTestSharder |
18 import run_java_tests | |
19 from run_java_tests import FatalTestException | |
20 from test_info_collection import TestInfoCollection | 22 from test_info_collection import TestInfoCollection |
21 from test_result import TestResults | |
22 | 23 |
23 | 24 |
24 def _GetPythonFiles(root, files): | 25 def _GetPythonFiles(root, files): |
25 """Returns all files from |files| that end in 'Test.py'. | 26 """Returns all files from |files| that end in 'Test.py'. |
26 | 27 |
27 Args: | 28 Args: |
28 root: A directory name with python files. | 29 root: A directory name with python files. |
29 files: A list of file names. | 30 files: A list of file names. |
30 | 31 |
31 Returns: | 32 Returns: |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 Returns: | 199 Returns: |
199 List of test case objects for all available test methods. | 200 List of test case objects for all available test methods. |
200 """ | 201 """ |
201 if not test_root: | 202 if not test_root: |
202 return [] | 203 return [] |
203 all_tests = [] | 204 all_tests = [] |
204 test_module_list = _GetTestModules(test_root, is_official_build) | 205 test_module_list = _GetTestModules(test_root, is_official_build) |
205 for module in test_module_list: | 206 for module in test_module_list: |
206 all_tests.extend(_GetTestClassesFromModule(module)) | 207 all_tests.extend(_GetTestClassesFromModule(module)) |
207 return all_tests | 208 return all_tests |
OLD | NEW |