| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 | 343 |
| 344 def GenerateJavaCoverageReport(options): | 344 def GenerateJavaCoverageReport(options): |
| 345 """Generates an HTML coverage report using EMMA and uploads it.""" | 345 """Generates an HTML coverage report using EMMA and uploads it.""" |
| 346 bb_annotations.PrintNamedStep('java_coverage_report') | 346 bb_annotations.PrintNamedStep('java_coverage_report') |
| 347 | 347 |
| 348 coverage_html = os.path.join(options.coverage_dir, 'coverage_html') | 348 coverage_html = os.path.join(options.coverage_dir, 'coverage_html') |
| 349 RunCmd(['build/android/generate_emma_html.py', | 349 RunCmd(['build/android/generate_emma_html.py', |
| 350 '--coverage-dir', options.coverage_dir, | 350 '--coverage-dir', options.coverage_dir, |
| 351 '--metadata-dir', os.path.join(CHROME_SRC, 'out', options.target), | 351 '--metadata-dir', os.path.join(CHROME_SRC, 'out', options.target), |
| 352 '--cleanup', |
| 352 '--output', os.path.join(coverage_html, 'index.html')]) | 353 '--output', os.path.join(coverage_html, 'index.html')]) |
| 353 UploadCoverageData(options, coverage_html, 'java') | 354 UploadCoverageData(options, coverage_html, 'java') |
| 354 | 355 |
| 355 | 356 |
| 356 def LogcatDump(options): | 357 def LogcatDump(options): |
| 357 # Print logcat, kill logcat monitor | 358 # Print logcat, kill logcat monitor |
| 358 bb_annotations.PrintNamedStep('logcat_dump') | 359 bb_annotations.PrintNamedStep('logcat_dump') |
| 359 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') | 360 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') |
| 360 with open(logcat_file, 'w') as f: | 361 with open(logcat_file, 'w') as f: |
| 361 RunCmd([ | 362 RunCmd([ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 378 SpawnLogcatMonitor() | 379 SpawnLogcatMonitor() |
| 379 | 380 |
| 380 # Run all device setup steps | 381 # Run all device setup steps |
| 381 for _, cmd in GetDeviceSetupStepCmds(): | 382 for _, cmd in GetDeviceSetupStepCmds(): |
| 382 cmd(options) | 383 cmd(options) |
| 383 | 384 |
| 384 if options.install: | 385 if options.install: |
| 385 test_obj = INSTRUMENTATION_TESTS[options.install] | 386 test_obj = INSTRUMENTATION_TESTS[options.install] |
| 386 InstallApk(options, test_obj, print_step=True) | 387 InstallApk(options, test_obj, print_step=True) |
| 387 | 388 |
| 388 if options.coverage_bucket: | |
| 389 RunCmd(['rm', '-rf', options.coverage_dir]) | |
| 390 | |
| 391 if options.test_filter: | 389 if options.test_filter: |
| 392 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) | 390 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
| 393 | 391 |
| 394 if options.coverage_bucket: | 392 if options.coverage_bucket: |
| 395 GenerateJavaCoverageReport(options) | 393 GenerateJavaCoverageReport(options) |
| 396 | 394 |
| 397 if options.experimental: | 395 if options.experimental: |
| 398 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) | 396 RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
| 399 | 397 |
| 400 finally: | 398 finally: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 448 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 451 if options.coverage_bucket: | 449 if options.coverage_bucket: |
| 452 setattr(options, 'coverage_dir', | 450 setattr(options, 'coverage_dir', |
| 453 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) | 451 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) |
| 454 | 452 |
| 455 MainTestWrapper(options) | 453 MainTestWrapper(options) |
| 456 | 454 |
| 457 | 455 |
| 458 if __name__ == '__main__': | 456 if __name__ == '__main__': |
| 459 sys.exit(main(sys.argv)) | 457 sys.exit(main(sys.argv)) |
| OLD | NEW |