| 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 | 6 |
| 7 import fnmatch | 7 import fnmatch |
| 8 import glob | 8 import glob |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| 11 import shutil | 11 import shutil |
| 12 import sys | 12 import sys |
| 13 | 13 |
| 14 from pylib import android_commands | 14 from pylib import android_commands |
| 15 from pylib import cmd_helper | 15 from pylib import cmd_helper |
| 16 from pylib import constants | 16 from pylib import constants |
| 17 from pylib import ports | 17 from pylib import ports |
| 18 | 18 |
| 19 import test_package_apk | 19 import test_package_apk |
| 20 import test_package_exe | 20 import test_package_exe |
| 21 import test_runner | 21 import test_runner |
| 22 | 22 |
| 23 sys.path.insert(0, | 23 sys.path.insert(0, |
| 24 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib')) | 24 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', |
| 25 from common import unittest_util | 25 'common')) |
| 26 import unittest_util |
| 26 | 27 |
| 27 | 28 |
| 28 _ISOLATE_FILE_PATHS = { | 29 _ISOLATE_FILE_PATHS = { |
| 29 'base_unittests': 'base/base_unittests.isolate', | 30 'base_unittests': 'base/base_unittests.isolate', |
| 30 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', | 31 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', |
| 31 'cc_perftests': 'cc/cc_perftests.isolate', | 32 'cc_perftests': 'cc/cc_perftests.isolate', |
| 32 'components_unittests': 'components/components_unittests.isolate', | 33 'components_unittests': 'components/components_unittests.isolate', |
| 33 'content_browsertests': 'content/content_browsertests.isolate', | 34 'content_browsertests': 'content/content_browsertests.isolate', |
| 34 'content_unittests': 'content/content_unittests.isolate', | 35 'content_unittests': 'content/content_unittests.isolate', |
| 35 'media_unittests': 'media/media_unittests.isolate', | 36 'media_unittests': 'media/media_unittests.isolate', |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 292 |
| 292 tests = _GetTestsFiltered(test_options.suite_name, test_options.gtest_filter, | 293 tests = _GetTestsFiltered(test_options.suite_name, test_options.gtest_filter, |
| 293 TestRunnerFactory, devices) | 294 TestRunnerFactory, devices) |
| 294 # Coalesce unit tests into a single test per device | 295 # Coalesce unit tests into a single test per device |
| 295 if test_options.suite_name != 'content_browsertests': | 296 if test_options.suite_name != 'content_browsertests': |
| 296 num_devices = len(devices) | 297 num_devices = len(devices) |
| 297 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 298 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
| 298 tests = [t for t in tests if t] | 299 tests = [t for t in tests if t] |
| 299 | 300 |
| 300 return (TestRunnerFactory, tests) | 301 return (TestRunnerFactory, tests) |
| OLD | NEW |