Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: build/android/buildbot/bb_device_steps.py

Issue 23189022: [Android] Adds directory cleanup/creation for code coverage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/setup.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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))
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698