| 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 multiprocessing | 9 import multiprocessing |
| 10 import os | 10 import os |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 def DeviceStatusCheck(_): | 275 def DeviceStatusCheck(_): |
| 276 bb_annotations.PrintNamedStep('device_status_check') | 276 bb_annotations.PrintNamedStep('device_status_check') |
| 277 RunCmd(['build/android/buildbot/bb_device_status_check.py'], | 277 RunCmd(['build/android/buildbot/bb_device_status_check.py'], |
| 278 halt_on_failure=True) | 278 halt_on_failure=True) |
| 279 | 279 |
| 280 | 280 |
| 281 def GetDeviceSetupStepCmds(): | 281 def GetDeviceSetupStepCmds(): |
| 282 return [ | 282 return [ |
| 283 ('provision_devices', ProvisionDevices), | 283 ('provision_devices', ProvisionDevices), |
| 284 ('device_status_check', DeviceStatusCheck) | 284 ('device_status_check', DeviceStatusCheck), |
| 285 ] | 285 ] |
| 286 | 286 |
| 287 | 287 |
| 288 def RunUnitTests(options): | 288 def RunUnitTests(options): |
| 289 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 289 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
| 290 | 290 |
| 291 | 291 |
| 292 def RunInstrumentationTests(options): | 292 def RunInstrumentationTests(options): |
| 293 for test in INSTRUMENTATION_TESTS.itervalues(): | 293 for test in INSTRUMENTATION_TESTS.itervalues(): |
| 294 RunInstrumentationSuite(options, test) | 294 RunInstrumentationSuite(options, test) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 SpawnLogcatMonitor() | 378 SpawnLogcatMonitor() |
| 379 | 379 |
| 380 # Run all device setup steps | 380 # Run all device setup steps |
| 381 for _, cmd in GetDeviceSetupStepCmds(): | 381 for _, cmd in GetDeviceSetupStepCmds(): |
| 382 cmd(options) | 382 cmd(options) |
| 383 | 383 |
| 384 if options.install: | 384 if options.install: |
| 385 test_obj = INSTRUMENTATION_TESTS[options.install] | 385 test_obj = INSTRUMENTATION_TESTS[options.install] |
| 386 InstallApk(options, test_obj, print_step=True) | 386 InstallApk(options, test_obj, print_step=True) |
| 387 | 387 |
| 388 if options.coverage_bucket: |
| 389 RunCmd(['rm', '-rf', options.coverage_dir]) |
| 390 |
| 388 if options.test_filter: | 391 if options.test_filter: |
| 389 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) | 392 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
| 390 | 393 |
| 391 if options.coverage_bucket: | 394 if options.coverage_bucket: |
| 392 GenerateJavaCoverageReport(options) | 395 GenerateJavaCoverageReport(options) |
| 393 | 396 |
| 394 if options.experimental: | 397 if options.experimental: |
| 395 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) | 398 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
| 396 | 399 |
| 397 finally: | 400 finally: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 450 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 448 if options.coverage_bucket: | 451 if options.coverage_bucket: |
| 449 setattr(options, 'coverage_dir', | 452 setattr(options, 'coverage_dir', |
| 450 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) | 453 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) |
| 451 | 454 |
| 452 MainTestWrapper(options) | 455 MainTestWrapper(options) |
| 453 | 456 |
| 454 | 457 |
| 455 if __name__ == '__main__': | 458 if __name__ == '__main__': |
| 456 sys.exit(main(sys.argv)) | 459 sys.exit(main(sys.argv)) |
| OLD | NEW |