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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
51 the Java tests run. If the python_only option is set, only the python tests | 51 the Java tests run. If the python_only option is set, only the python tests |
52 run. If neither are set, run both Java and Python tests. | 52 run. If neither are set, run both Java and Python tests. |
53 | 53 |
54 Args: | 54 Args: |
55 options: command-line options for running the Java and Python tests. | 55 options: command-line options for running the Java and Python tests. |
56 | 56 |
57 Returns: | 57 Returns: |
58 An integer representing the number of failing tests. | 58 An integer representing the number of failing tests. |
59 """ | 59 """ |
60 # Reset the test port allocation. It's important to do it before starting | 60 if not options.keep_test_server_ports: |
61 # to dispatch any tests. | 61 # Reset the test port allocation. It's important to do it before starting |
62 if not ports.ResetTestServerPortAllocation(): | 62 # to dispatch any tests. |
63 raise Exception('Failed to reset test server port.') | 63 if not ports.ResetTestServerPortAllocation(): |
| 64 raise Exception('Failed to reset test server port.') |
| 65 |
64 start_date = int(time.time() * 1000) | 66 start_date = int(time.time() * 1000) |
65 java_results = TestResults() | 67 java_results = TestResults() |
66 python_results = TestResults() | 68 python_results = TestResults() |
67 | 69 |
68 if options.run_java_tests: | 70 if options.run_java_tests: |
69 java_results = run_java_tests.DispatchJavaTests( | 71 java_results = run_java_tests.DispatchJavaTests( |
70 options, | 72 options, |
71 [apk_info.ApkInfo(options.test_apk_path, options.test_apk_jar_path)]) | 73 [apk_info.ApkInfo(options.test_apk_path, options.test_apk_jar_path)]) |
72 if options.run_python_tests: | 74 if options.run_python_tests: |
73 python_results = run_python_tests.DispatchPythonTests(options) | 75 python_results = run_python_tests.DispatchPythonTests(options) |
(...skipping 20 matching lines...) Expand all Loading... |
94 buildbot_report.PrintNamedStep( | 96 buildbot_report.PrintNamedStep( |
95 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), | 97 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), |
96 options.test_apk)) | 98 options.test_apk)) |
97 ret = DispatchInstrumentationTests(options) | 99 ret = DispatchInstrumentationTests(options) |
98 buildbot_report.PrintStepResultIfNeeded(options, ret) | 100 buildbot_report.PrintStepResultIfNeeded(options, ret) |
99 return ret | 101 return ret |
100 | 102 |
101 | 103 |
102 if __name__ == '__main__': | 104 if __name__ == '__main__': |
103 sys.exit(main(sys.argv)) | 105 sys.exit(main(sys.argv)) |
OLD | NEW |