Chromium Code Reviews| 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 ('coverage_setup', CoverageSetup) | |
| 272 ] | 273 ] |
| 273 | 274 |
| 274 | 275 |
| 275 def RunUnitTests(options): | 276 def RunUnitTests(options): |
| 276 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 277 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
| 277 | 278 |
| 278 | 279 |
| 279 def RunInstrumentationTests(options): | 280 def RunInstrumentationTests(options): |
| 280 for test in INSTRUMENTATION_TESTS.itervalues(): | 281 for test in INSTRUMENTATION_TESTS.itervalues(): |
| 281 RunInstrumentationSuite(options, test) | 282 RunInstrumentationSuite(options, test) |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 294 return [ | 295 return [ |
| 295 ('chromedriver', RunChromeDriverTests), | 296 ('chromedriver', RunChromeDriverTests), |
| 296 ('unit', RunUnitTests), | 297 ('unit', RunUnitTests), |
| 297 ('ui', RunInstrumentationTests), | 298 ('ui', RunInstrumentationTests), |
| 298 ('webkit', RunWebkitTests), | 299 ('webkit', RunWebkitTests), |
| 299 ('webkit_layout', RunWebkitLayoutTests), | 300 ('webkit_layout', RunWebkitLayoutTests), |
| 300 ('webrtc', RunWebRTCTests), | 301 ('webrtc', RunWebRTCTests), |
| 301 ] | 302 ] |
| 302 | 303 |
| 303 | 304 |
| 305 def CoverageSetup(options): | |
| 306 """Sets up the coverage directory as a buildbot step.""" | |
| 307 if options.coverage_bucket: | |
| 308 bb_annotations.PrintNamedStep('coverage_setup') | |
| 309 print 'Clearing the coverange directory: %s' % options.coverage_dir | |
| 310 shutil.rmtree(options.coverage_dir, ignore_errors=True) | |
| 311 os.mkdir(options.coverage_dir) | |
|
frankf
2013/08/24 02:17:19
It makes more sense to do this in pylib/instrument
| |
| 312 | |
| 313 | |
| 304 def UploadCoverageData(options, path, coverage_type): | 314 def UploadCoverageData(options, path, coverage_type): |
| 305 """Uploads directory at |path| to Google Storage. | 315 """Uploads directory at |path| to Google Storage. |
| 306 | 316 |
| 307 The directory at path should ostensibly contain HTML coverage data. | 317 The directory at path should ostensibly contain HTML coverage data. |
| 308 | 318 |
| 309 Args: | 319 Args: |
| 310 options: Command line options. | 320 options: Command line options. |
| 311 path: Path to the directory to be uploaded. | 321 path: Path to the directory to be uploaded. |
| 312 coverage_type: String used as the first component of the url. | 322 coverage_type: String used as the first component of the url. |
| 313 | 323 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 444 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 435 if options.coverage_bucket: | 445 if options.coverage_bucket: |
| 436 setattr(options, 'coverage_dir', | 446 setattr(options, 'coverage_dir', |
| 437 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) | 447 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) |
| 438 | 448 |
| 439 MainTestWrapper(options) | 449 MainTestWrapper(options) |
| 440 | 450 |
| 441 | 451 |
| 442 if __name__ == '__main__': | 452 if __name__ == '__main__': |
| 443 sys.exit(main(sys.argv)) | 453 sys.exit(main(sys.argv)) |
| OLD | NEW |