| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import collections | 6 import collections |
| 7 import glob | 7 import glob |
| 8 import hashlib | 8 import hashlib |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 """ | 183 """ |
| 184 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) | 184 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) |
| 185 args = ['--browser', 'android-chrome-shell'] | 185 args = ['--browser', 'android-chrome-shell'] |
| 186 devices = android_commands.GetAttachedDevices() | 186 devices = android_commands.GetAttachedDevices() |
| 187 if devices: | 187 if devices: |
| 188 args = args + ['--device', devices[0]] | 188 args = args + ['--device', devices[0]] |
| 189 bb_annotations.PrintNamedStep('chrome_proxy') | 189 bb_annotations.PrintNamedStep('chrome_proxy') |
| 190 RunCmd(['tools/chrome_proxy/run_tests'] + args) | 190 RunCmd(['tools/chrome_proxy/run_tests'] + args) |
| 191 | 191 |
| 192 | 192 |
| 193 def RunTelemetryTests(options, run_tests_path): | 193 def RunTelemetryTests(options, step_name, run_tests_path): |
| 194 """Runs either telemetry_perf_unittests or telemetry_unittests. | 194 """Runs either telemetry_perf_unittests or telemetry_unittests. |
| 195 | 195 |
| 196 Args: | 196 Args: |
| 197 options: options object. | 197 options: options object. |
| 198 step_name: either 'telemetry_unittests' or 'telemetry_perf_unittests' |
| 198 run_tests_path: path to run_tests script (tools/perf/run_tests for | 199 run_tests_path: path to run_tests script (tools/perf/run_tests for |
| 199 perf_unittests and tools/telemetry/run_tests for | 200 perf_unittests and tools/telemetry/run_tests for |
| 200 telemetry_unittests) | 201 telemetry_unittests) |
| 201 """ | 202 """ |
| 202 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) | 203 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) |
| 203 args = ['--browser', 'android-chrome-shell'] | 204 args = ['--browser', 'android-chrome-shell'] |
| 204 devices = android_commands.GetAttachedDevices() | 205 devices = android_commands.GetAttachedDevices() |
| 205 if devices: | 206 if devices: |
| 206 args = args + ['--device', devices[0]] | 207 args = args + ['--device', devices[0]] |
| 207 bb_annotations.PrintNamedStep('telemetry_perf_unittests') | 208 bb_annotations.PrintNamedStep(step_name) |
| 208 RunCmd([run_tests_path] + args) | 209 RunCmd([run_tests_path] + args) |
| 209 | 210 |
| 210 | 211 |
| 211 def InstallApk(options, test, print_step=False): | 212 def InstallApk(options, test, print_step=False): |
| 212 """Install an apk to all phones. | 213 """Install an apk to all phones. |
| 213 | 214 |
| 214 Args: | 215 Args: |
| 215 options: options object | 216 options: options object |
| 216 test: An I_TEST namedtuple | 217 test: An I_TEST namedtuple |
| 217 print_step: Print a buildbot step | 218 print_step: Print a buildbot step |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 470 |
| 470 def RunUnitTests(options): | 471 def RunUnitTests(options): |
| 471 suites = gtest_config.STABLE_TEST_SUITES | 472 suites = gtest_config.STABLE_TEST_SUITES |
| 472 if options.asan: | 473 if options.asan: |
| 473 suites = [s for s in suites | 474 suites = [s for s in suites |
| 474 if s not in gtest_config.ASAN_EXCLUDED_TEST_SUITES] | 475 if s not in gtest_config.ASAN_EXCLUDED_TEST_SUITES] |
| 475 RunTestSuites(options, suites) | 476 RunTestSuites(options, suites) |
| 476 | 477 |
| 477 | 478 |
| 478 def RunTelemetryUnitTests(options): | 479 def RunTelemetryUnitTests(options): |
| 479 RunTelemetryTests(options, 'tools/telemetry/run_tests') | 480 RunTelemetryTests(options, 'telemetry_unittests', 'tools/telemetry/run_tests') |
| 480 | 481 |
| 481 | 482 |
| 482 def RunTelemetryPerfUnitTests(options): | 483 def RunTelemetryPerfUnitTests(options): |
| 483 RunTelemetryTests(options, 'tools/perf/run_tests') | 484 RunTelemetryTests(options, 'telemetry_perf_unittests', 'tools/perf/run_tests') |
| 485 |
| 484 | 486 |
| 485 def RunInstrumentationTests(options): | 487 def RunInstrumentationTests(options): |
| 486 for test in INSTRUMENTATION_TESTS.itervalues(): | 488 for test in INSTRUMENTATION_TESTS.itervalues(): |
| 487 RunInstrumentationSuite(options, test) | 489 RunInstrumentationSuite(options, test) |
| 488 | 490 |
| 489 | 491 |
| 490 def RunWebkitTests(options): | 492 def RunWebkitTests(options): |
| 491 RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests']) | 493 RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests']) |
| 492 RunWebkitLint() | 494 RunWebkitLint() |
| 493 | 495 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 | 736 |
| 735 if options.coverage_bucket: | 737 if options.coverage_bucket: |
| 736 setattr(options, 'coverage_dir', | 738 setattr(options, 'coverage_dir', |
| 737 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 739 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
| 738 | 740 |
| 739 MainTestWrapper(options) | 741 MainTestWrapper(options) |
| 740 | 742 |
| 741 | 743 |
| 742 if __name__ == '__main__': | 744 if __name__ == '__main__': |
| 743 sys.exit(main(sys.argv)) | 745 sys.exit(main(sys.argv)) |
| OLD | NEW |