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 logging | 8 import logging |
9 import os | 9 import os |
10 import sys | 10 import sys |
11 | 11 |
12 from pylib import constants | 12 from pylib import constants |
13 | 13 |
14 from pylib.base import base_setup | 14 from pylib.base import base_setup |
15 from pylib.base import base_test_result | 15 from pylib.base import base_test_result |
16 from pylib.base import test_dispatcher | 16 from pylib.base import test_dispatcher |
17 from pylib.device import device_utils | 17 from pylib.device import device_utils |
18 from pylib.gtest import gtest_test_instance | 18 from pylib.gtest import gtest_test_instance |
19 from pylib.gtest import test_package_apk | 19 from pylib.gtest import test_package_apk |
20 from pylib.gtest import test_package_exe | 20 from pylib.gtest import test_package_exe |
21 from pylib.gtest import test_runner | 21 from pylib.gtest 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 'common')) | 25 'common')) |
26 import unittest_util # pylint: disable=F0401 | 26 import unittest_util # pylint: disable=F0401 |
27 | 27 |
28 | 28 |
29 ISOLATE_FILE_PATHS = { | 29 ISOLATE_FILE_PATHS = gtest_test_instance._DEFAULT_ISOLATE_FILE_PATHS |
30 'base_unittests': 'base/base_unittests.isolate', | 30 |
31 'blink_heap_unittests': | |
32 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate', | |
33 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', | |
34 'cc_perftests': 'cc/cc_perftests.isolate', | |
35 'components_browsertests': 'components/components_browsertests.isolate', | |
36 'components_unittests': 'components/components_unittests.isolate', | |
37 'content_browsertests': 'content/content_browsertests.isolate', | |
38 'content_unittests': 'content/content_unittests.isolate', | |
39 'media_perftests': 'media/media_perftests.isolate', | |
40 'media_unittests': 'media/media_unittests.isolate', | |
41 'midi_unittests': 'media/midi/midi_unittests.isolate', | |
42 'net_unittests': 'net/net_unittests.isolate', | |
43 'sql_unittests': 'sql/sql_unittests.isolate', | |
44 'sync_unit_tests': 'sync/sync_unit_tests.isolate', | |
45 'ui_base_unittests': 'ui/base/ui_base_tests.isolate', | |
46 'unit_tests': 'chrome/unit_tests.isolate', | |
47 'webkit_unit_tests': | |
48 'third_party/WebKit/Source/web/WebKitUnitTests.isolate', | |
49 } | |
50 | 31 |
51 # Used for filtering large data deps at a finer grain than what's allowed in | 32 # Used for filtering large data deps at a finer grain than what's allowed in |
52 # isolate files since pushing deps to devices is expensive. | 33 # isolate files since pushing deps to devices is expensive. |
53 # Wildcards are allowed. | 34 # Wildcards are allowed. |
54 DEPS_EXCLUSION_LIST = [ | 35 DEPS_EXCLUSION_LIST = [ |
55 'chrome/test/data/extensions/api_test', | 36 'chrome/test/data/extensions/api_test', |
56 'chrome/test/data/extensions/secure_shell', | 37 'chrome/test/data/extensions/secure_shell', |
57 'chrome/test/data/firefox*', | 38 'chrome/test/data/firefox*', |
58 'chrome/test/data/gpu', | 39 'chrome/test/data/gpu', |
59 'chrome/test/data/image_decoding', | 40 'chrome/test/data/image_decoding', |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if test_options.gtest_filter: | 221 if test_options.gtest_filter: |
241 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 222 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
242 | 223 |
243 # Coalesce unit tests into a single test per device | 224 # Coalesce unit tests into a single test per device |
244 if test_options.suite_name not in gtest_test_instance.BROWSER_TEST_SUITES: | 225 if test_options.suite_name not in gtest_test_instance.BROWSER_TEST_SUITES: |
245 num_devices = len(devices) | 226 num_devices = len(devices) |
246 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 227 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
247 tests = [t for t in tests if t] | 228 tests = [t for t in tests if t] |
248 | 229 |
249 return (TestRunnerFactory, tests) | 230 return (TestRunnerFactory, tests) |
OLD | NEW |