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 tests.""" | 7 """Runs both the Python and Java tests.""" |
8 | 8 |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 19 matching lines...) Expand all Loading... |
30 java_results: a TestResults object with java test case results. | 30 java_results: a TestResults object with java test case results. |
31 python_results: a TestResults object with python test case results. | 31 python_results: a TestResults object with python test case results. |
32 annotation: the annotation used for these results. | 32 annotation: the annotation used for these results. |
33 build_type: 'Release' or 'Debug'. | 33 build_type: 'Release' or 'Debug'. |
34 | 34 |
35 Returns: | 35 Returns: |
36 A tuple (all_results, summary_string, num_failing) | 36 A tuple (all_results, summary_string, num_failing) |
37 """ | 37 """ |
38 all_results = TestResults.FromTestResults([java_results, python_results]) | 38 all_results = TestResults.FromTestResults([java_results, python_results]) |
39 summary_string = all_results.LogFull('Instrumentation', annotation, | 39 summary_string = all_results.LogFull('Instrumentation', annotation, |
40 build_type) | 40 build_type, []) |
41 num_failing = (len(all_results.failed) + len(all_results.crashed) + | 41 num_failing = (len(all_results.failed) + len(all_results.crashed) + |
42 len(all_results.unknown)) | 42 len(all_results.unknown)) |
43 return all_results, summary_string, num_failing | 43 return all_results, summary_string, num_failing |
44 | 44 |
45 | 45 |
46 def DispatchInstrumentationTests(options): | 46 def DispatchInstrumentationTests(options): |
47 """Dispatches the Java and Python instrumentation tests, sharding if possible. | 47 """Dispatches the Java and Python instrumentation tests, sharding if possible. |
48 | 48 |
49 Uses the logging module to print the combined final results and | 49 Uses the logging module to print the combined final results and |
50 summary of the Java and Python tests. If the java_only option is set, only | 50 summary of the Java and Python tests. If the java_only option is set, only |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 buildbot_report.PrintNamedStep( | 96 buildbot_report.PrintNamedStep( |
97 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), | 97 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), |
98 options.test_apk)) | 98 options.test_apk)) |
99 ret = DispatchInstrumentationTests(options) | 99 ret = DispatchInstrumentationTests(options) |
100 buildbot_report.PrintStepResultIfNeeded(options, ret) | 100 buildbot_report.PrintStepResultIfNeeded(options, ret) |
101 return ret | 101 return ret |
102 | 102 |
103 | 103 |
104 if __name__ == '__main__': | 104 if __name__ == '__main__': |
105 sys.exit(main(sys.argv)) | 105 sys.exit(main(sys.argv)) |
OLD | NEW |