| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Runs both the Python and Java instrumentation tests.""" | 7 """Runs both the Python and Java instrumentation tests.""" |
| 8 | 8 |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 if options.run_java_tests: | 45 if options.run_java_tests: |
| 46 all_results.AddTestRunResults(dispatch.Dispatch(options)) | 46 all_results.AddTestRunResults(dispatch.Dispatch(options)) |
| 47 if options.run_python_tests: | 47 if options.run_python_tests: |
| 48 all_results.AddTestRunResults(run_python_tests.DispatchPythonTests(options)) | 48 all_results.AddTestRunResults(run_python_tests.DispatchPythonTests(options)) |
| 49 | 49 |
| 50 report_results.LogFull( | 50 report_results.LogFull( |
| 51 results=all_results, | 51 results=all_results, |
| 52 test_type='Instrumentation', | 52 test_type='Instrumentation', |
| 53 test_package=os.path.basename(options.test_apk), | 53 test_package=os.path.basename(options.test_apk), |
| 54 annotation=options.annotation, | 54 annotation=options.annotations, |
| 55 build_type=options.build_type, | 55 build_type=options.build_type, |
| 56 flakiness_server=options.flakiness_dashboard_server) | 56 flakiness_server=options.flakiness_dashboard_server) |
| 57 | 57 |
| 58 return len(all_results.GetNotPass()) | 58 return len(all_results.GetNotPass()) |
| 59 | 59 |
| 60 | 60 |
| 61 def main(argv): | 61 def main(argv): |
| 62 option_parser = optparse.OptionParser() | 62 option_parser = optparse.OptionParser() |
| 63 test_options_parser.AddInstrumentationOptions(option_parser) | 63 test_options_parser.AddInstrumentationOptions(option_parser) |
| 64 options, args = option_parser.parse_args(argv) | 64 options, args = option_parser.parse_args(argv) |
| 65 test_options_parser.ValidateInstrumentationOptions(option_parser, options, | 65 test_options_parser.ValidateInstrumentationOptions(option_parser, options, |
| 66 args) | 66 args) |
| 67 | 67 |
| 68 run_tests_helper.SetLogLevel(options.verbose_count) | 68 run_tests_helper.SetLogLevel(options.verbose_count) |
| 69 ret = 1 | 69 ret = 1 |
| 70 try: | 70 try: |
| 71 ret = DispatchInstrumentationTests(options) | 71 ret = DispatchInstrumentationTests(options) |
| 72 finally: | 72 finally: |
| 73 buildbot_report.PrintStepResultIfNeeded(options, ret) | 73 buildbot_report.PrintStepResultIfNeeded(options, ret) |
| 74 return ret | 74 return ret |
| 75 | 75 |
| 76 | 76 |
| 77 if __name__ == '__main__': | 77 if __name__ == '__main__': |
| 78 sys.exit(main(sys.argv)) | 78 sys.exit(main(sys.argv)) |
| OLD | NEW |