OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 | 6 |
7 import logging | 7 import logging |
8 import re | 8 import re |
9 import os | 9 import os |
10 import pexpect | 10 import pexpect |
(...skipping 30 matching lines...) Expand all Loading... | |
41 self.test_suite_dirname = os.path.dirname(self.test_suite) | 41 self.test_suite_dirname = os.path.dirname(self.test_suite) |
42 self.rebaseline = rebaseline | 42 self.rebaseline = rebaseline |
43 self.performance_test = performance_test | 43 self.performance_test = performance_test |
44 self.cleanup_test_files = cleanup_test_files | 44 self.cleanup_test_files = cleanup_test_files |
45 self.tool = CreateTool(tool, self.adb) | 45 self.tool = CreateTool(tool, self.adb) |
46 if timeout == 0: | 46 if timeout == 0: |
47 if self.test_suite_basename == 'page_cycler_tests': | 47 if self.test_suite_basename == 'page_cycler_tests': |
48 timeout = 900 | 48 timeout = 900 |
49 else: | 49 else: |
50 timeout = 60 | 50 timeout = 60 |
51 # On a VM (e.g. chromium buildbots), this timeout is way too small. | |
52 if os.environ.get('BUILDBOT_SLAVENAME'): | |
michaelbai
2011/11/21 23:05:53
What's if the environment was not set in dev machi
John Grabowski
2011/11/21 23:07:13
No; it returns None. That's why I'm using get() i
| |
53 timeout = timeout * 2 | |
51 self.timeout = timeout * self.tool.GetTimeoutScale() | 54 self.timeout = timeout * self.tool.GetTimeoutScale() |
52 self.dump_debug_info = dump_debug_info | 55 self.dump_debug_info = dump_debug_info |
53 | 56 |
54 def _BeginGetIOStats(self): | 57 def _BeginGetIOStats(self): |
55 """Gets I/O statistics before running test. | 58 """Gets I/O statistics before running test. |
56 | 59 |
57 Return: | 60 Return: |
58 Tuple of (I/O stats object, flag of ready to continue). When encountering | 61 Tuple of (I/O stats object, flag of ready to continue). When encountering |
59 error, ready-to-continue flag is False, True otherwise. The I/O stats | 62 error, ready-to-continue flag is False, True otherwise. The I/O stats |
60 object may be None if the test is not performance test. | 63 object may be None if the test is not performance test. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 if not self.rebaseline and ready_to_continue: | 158 if not self.rebaseline and ready_to_continue: |
156 ok_tests += self._EndGetIOStats(io_stats_before) | 159 ok_tests += self._EndGetIOStats(io_stats_before) |
157 ret_code = self._GetGTestReturnCode() | 160 ret_code = self._GetGTestReturnCode() |
158 if ret_code: | 161 if ret_code: |
159 failed_tests += [BaseTestResult('gtest exit code: %d' % ret_code, | 162 failed_tests += [BaseTestResult('gtest exit code: %d' % ret_code, |
160 'pexpect.before: %s' | 163 'pexpect.before: %s' |
161 '\npexpect.after: %s' | 164 '\npexpect.after: %s' |
162 % (p.before, | 165 % (p.before, |
163 p.after))] | 166 p.after))] |
164 return TestResults.FromOkAndFailed(ok_tests, failed_tests) | 167 return TestResults.FromOkAndFailed(ok_tests, failed_tests) |
OLD | NEW |