| 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 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 'media_perftests': 'media/media_perftests.isolate', | 39 'media_perftests': 'media/media_perftests.isolate', |
| 40 'media_unittests': 'media/media_unittests.isolate', | 40 'media_unittests': 'media/media_unittests.isolate', |
| 41 'net_unittests': 'net/net_unittests.isolate', | 41 'net_unittests': 'net/net_unittests.isolate', |
| 42 'sql_unittests': 'sql/sql_unittests.isolate', | 42 'sql_unittests': 'sql/sql_unittests.isolate', |
| 43 'ui_unittests': 'ui/ui_unittests.isolate', | 43 'ui_unittests': 'ui/ui_unittests.isolate', |
| 44 'unit_tests': 'chrome/unit_tests.isolate', | 44 'unit_tests': 'chrome/unit_tests.isolate', |
| 45 'webkit_unit_tests': | 45 'webkit_unit_tests': |
| 46 'third_party/WebKit/Source/web/WebKitUnitTests.isolate', | 46 'third_party/WebKit/Source/web/WebKitUnitTests.isolate', |
| 47 } | 47 } |
| 48 | 48 |
| 49 # Paths relative to third_party/webrtc/ (kept separate for readability). | |
| 50 _WEBRTC_ISOLATE_FILE_PATHS = { | |
| 51 'audio_decoder_unittests': | |
| 52 'modules/audio_coding/neteq/audio_decoder_unittests.isolate', | |
| 53 'common_audio_unittests': 'common_audio/common_audio_unittests.isolate', | |
| 54 'common_video_unittests': 'common_video/common_video_unittests.isolate', | |
| 55 'modules_tests': 'modules/modules_tests.isolate', | |
| 56 'modules_unittests': 'modules/modules_unittests.isolate', | |
| 57 'system_wrappers_unittests': | |
| 58 'system_wrappers/source/system_wrappers_unittests.isolate', | |
| 59 'test_support_unittests': 'test/test_support_unittests.isolate', | |
| 60 'tools_unittests': 'tools/tools_unittests.isolate', | |
| 61 'video_engine_tests': 'video_engine_tests.isolate', | |
| 62 'video_engine_core_unittests': | |
| 63 'video_engine/video_engine_core_unittests.isolate', | |
| 64 'voice_engine_unittests': 'voice_engine/voice_engine_unittests.isolate', | |
| 65 'webrtc_perf_tests': 'webrtc_perf_tests.isolate', | |
| 66 } | |
| 67 | |
| 68 # Append the WebRTC tests with the full path from Chromium's src/ root. | |
| 69 for webrtc_test, isolate_path in _WEBRTC_ISOLATE_FILE_PATHS.items(): | |
| 70 _ISOLATE_FILE_PATHS[webrtc_test] = 'third_party/webrtc/%s' % isolate_path | |
| 71 | |
| 72 # Used for filtering large data deps at a finer grain than what's allowed in | 49 # Used for filtering large data deps at a finer grain than what's allowed in |
| 73 # isolate files since pushing deps to devices is expensive. | 50 # isolate files since pushing deps to devices is expensive. |
| 74 # Wildcards are allowed. | 51 # Wildcards are allowed. |
| 75 _DEPS_EXCLUSION_LIST = [ | 52 _DEPS_EXCLUSION_LIST = [ |
| 76 'chrome/test/data/extensions/api_test', | 53 'chrome/test/data/extensions/api_test', |
| 77 'chrome/test/data/extensions/secure_shell', | 54 'chrome/test/data/extensions/secure_shell', |
| 78 'chrome/test/data/firefox*', | 55 'chrome/test/data/firefox*', |
| 79 'chrome/test/data/gpu', | 56 'chrome/test/data/gpu', |
| 80 'chrome/test/data/image_decoding', | 57 'chrome/test/data/image_decoding', |
| 81 'chrome/test/data/import', | 58 'chrome/test/data/import', |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 isolate_file_path) | 91 isolate_file_path) |
| 115 else: | 92 else: |
| 116 isolate_rel_path = _ISOLATE_FILE_PATHS.get(suite_name) | 93 isolate_rel_path = _ISOLATE_FILE_PATHS.get(suite_name) |
| 117 if not isolate_rel_path: | 94 if not isolate_rel_path: |
| 118 logging.info('Did not find an isolate file for the test suite.') | 95 logging.info('Did not find an isolate file for the test suite.') |
| 119 return | 96 return |
| 120 isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) | 97 isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) |
| 121 | 98 |
| 122 isolated_abs_path = os.path.join( | 99 isolated_abs_path = os.path.join( |
| 123 constants.GetOutDirectory(), '%s.isolated' % suite_name) | 100 constants.GetOutDirectory(), '%s.isolated' % suite_name) |
| 124 assert os.path.exists(isolate_abs_path) | 101 assert os.path.exists(isolate_abs_path), 'Cannot find %s' % isolate_abs_path |
| 125 # This needs to be kept in sync with the cmd line options for isolate.py | 102 # This needs to be kept in sync with the cmd line options for isolate.py |
| 126 # in src/build/isolate.gypi. | 103 # in src/build/isolate.gypi. |
| 127 isolate_cmd = [ | 104 isolate_cmd = [ |
| 128 'python', _ISOLATE_SCRIPT, | 105 'python', _ISOLATE_SCRIPT, |
| 129 'remap', | 106 'remap', |
| 130 '--isolate', isolate_abs_path, | 107 '--isolate', isolate_abs_path, |
| 131 '--isolated', isolated_abs_path, | 108 '--isolated', isolated_abs_path, |
| 132 '--outdir', constants.ISOLATE_DEPS_DIR, | 109 '--outdir', constants.ISOLATE_DEPS_DIR, |
| 133 | 110 |
| 134 '--path-variable', 'DEPTH', constants.DIR_SOURCE_ROOT, | 111 '--path-variable', 'DEPTH', constants.DIR_SOURCE_ROOT, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 if test_options.gtest_filter: | 324 if test_options.gtest_filter: |
| 348 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 325 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
| 349 | 326 |
| 350 # Coalesce unit tests into a single test per device | 327 # Coalesce unit tests into a single test per device |
| 351 if test_options.suite_name != 'content_browsertests': | 328 if test_options.suite_name != 'content_browsertests': |
| 352 num_devices = len(devices) | 329 num_devices = len(devices) |
| 353 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 330 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
| 354 tests = [t for t in tests if t] | 331 tests = [t for t in tests if t] |
| 355 | 332 |
| 356 return (TestRunnerFactory, tests) | 333 return (TestRunnerFactory, tests) |
| OLD | NEW |