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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 | 261 |
262 def DeviceStatusCheck(_): | 262 def DeviceStatusCheck(_): |
263 bb_annotations.PrintNamedStep('device_status_check') | 263 bb_annotations.PrintNamedStep('device_status_check') |
264 RunCmd(['build/android/buildbot/bb_device_status_check.py'], | 264 RunCmd(['build/android/buildbot/bb_device_status_check.py'], |
265 halt_on_failure=True) | 265 halt_on_failure=True) |
266 | 266 |
267 | 267 |
268 def GetDeviceSetupStepCmds(): | 268 def GetDeviceSetupStepCmds(): |
269 return [ | 269 return [ |
270 ('provision_devices', ProvisionDevices), | 270 ('provision_devices', ProvisionDevices), |
271 ('device_status_check', DeviceStatusCheck) | 271 ('device_status_check', DeviceStatusCheck), |
272 ] | 272 ] |
273 | 273 |
274 | 274 |
275 def RunUnitTests(options): | 275 def RunUnitTests(options): |
276 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 276 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
277 | 277 |
278 | 278 |
279 def RunInstrumentationTests(options): | 279 def RunInstrumentationTests(options): |
280 for test in INSTRUMENTATION_TESTS.itervalues(): | 280 for test in INSTRUMENTATION_TESTS.itervalues(): |
281 RunInstrumentationSuite(options, test) | 281 RunInstrumentationSuite(options, test) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 SpawnLogcatMonitor() | 365 SpawnLogcatMonitor() |
366 | 366 |
367 # Run all device setup steps | 367 # Run all device setup steps |
368 for _, cmd in GetDeviceSetupStepCmds(): | 368 for _, cmd in GetDeviceSetupStepCmds(): |
369 cmd(options) | 369 cmd(options) |
370 | 370 |
371 if options.install: | 371 if options.install: |
372 test_obj = INSTRUMENTATION_TESTS[options.install] | 372 test_obj = INSTRUMENTATION_TESTS[options.install] |
373 InstallApk(options, test_obj, print_step=True) | 373 InstallApk(options, test_obj, print_step=True) |
374 | 374 |
375 if options.coverage_bucket: | |
376 shutil.rmtree(options.coverage_dir, ignore_errors=True) | |
Isaac (away)
2013/08/25 00:25:41
This is a silent command and it runs during testin
frankf
2013/08/26 17:49:00
Done.
| |
377 | |
375 if options.test_filter: | 378 if options.test_filter: |
376 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) | 379 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
377 | 380 |
378 if options.coverage_bucket: | 381 if options.coverage_bucket: |
379 GenerateJavaCoverageReport(options) | 382 GenerateJavaCoverageReport(options) |
380 | 383 |
381 if options.experimental: | 384 if options.experimental: |
382 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) | 385 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
383 | 386 |
384 finally: | 387 finally: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 437 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
435 if options.coverage_bucket: | 438 if options.coverage_bucket: |
436 setattr(options, 'coverage_dir', | 439 setattr(options, 'coverage_dir', |
437 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) | 440 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) |
438 | 441 |
439 MainTestWrapper(options) | 442 MainTestWrapper(options) |
440 | 443 |
441 | 444 |
442 if __name__ == '__main__': | 445 if __name__ == '__main__': |
443 sys.exit(main(sys.argv)) | 446 sys.exit(main(sys.argv)) |
OLD | NEW |