OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Generates test runner factory and tests for GTests.""" | 5 """Generates test runner factory and tests for GTests.""" |
6 # pylint: disable=W0212 | 6 # pylint: disable=W0212 |
7 | 7 |
8 import fnmatch | 8 import fnmatch |
9 import glob | 9 import glob |
10 import logging | 10 import logging |
11 import os | 11 import os |
12 import shutil | 12 import shutil |
13 import sys | 13 import sys |
14 | 14 |
15 from pylib import android_commands | 15 from pylib import android_commands |
16 from pylib import cmd_helper | 16 from pylib import cmd_helper |
17 from pylib import constants | 17 from pylib import constants |
| 18 |
18 from pylib.gtest import test_package_apk | 19 from pylib.gtest import test_package_apk |
19 from pylib.gtest import test_package_exe | 20 from pylib.gtest import test_package_exe |
20 from pylib.gtest import test_runner | 21 from pylib.gtest import test_runner |
21 | 22 |
22 sys.path.insert(0, | 23 sys.path.insert(0, |
23 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', | 24 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', |
24 'common')) | 25 'common')) |
25 import unittest_util # pylint: disable=F0401 | 26 import unittest_util # pylint: disable=F0401 |
26 | 27 |
27 | 28 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if test_options.gtest_filter: | 317 if test_options.gtest_filter: |
317 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 318 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
318 | 319 |
319 # Coalesce unit tests into a single test per device | 320 # Coalesce unit tests into a single test per device |
320 if test_options.suite_name != 'content_browsertests': | 321 if test_options.suite_name != 'content_browsertests': |
321 num_devices = len(devices) | 322 num_devices = len(devices) |
322 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 323 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
323 tests = [t for t in tests if t] | 324 tests = [t for t in tests if t] |
324 | 325 |
325 return (TestRunnerFactory, tests) | 326 return (TestRunnerFactory, tests) |
OLD | NEW |