OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 import re | 6 import re |
7 | 7 |
8 # http://developer.android.com/reference/android/test/InstrumentationTestRunner. html | 8 # http://developer.android.com/reference/android/test/InstrumentationTestRunner. html |
9 STATUS_CODE_START = 1 | 9 STATUS_CODE_START = 1 |
10 STATUS_CODE_OK = 0 | 10 STATUS_CODE_OK = 0 |
11 STATUS_CODE_ERROR = -1 | 11 STATUS_CODE_ERROR = -1 |
12 STATUS_CODE_FAILURE = -2 | 12 STATUS_CODE_FAILURE = -2 |
13 STATUS_CODE_SKIP = -3 | |
jbudorick
2016/08/24 15:55:23
Can you add a test that covers this in instrumenta
the real yoland
2016/08/24 20:24:33
Done
| |
13 | 14 |
14 # http://developer.android.com/reference/android/app/Activity.html | 15 # http://developer.android.com/reference/android/app/Activity.html |
15 RESULT_CODE_OK = -1 | 16 RESULT_CODE_OK = -1 |
16 RESULT_CODE_CANCELED = 0 | 17 RESULT_CODE_CANCELED = 0 |
17 | 18 |
18 _INSTR_LINE_RE = re.compile(r'^\s*INSTRUMENTATION_([A-Z_]+): (.*)$') | 19 _INSTR_LINE_RE = re.compile(r'^\s*INSTRUMENTATION_([A-Z_]+): (.*)$') |
19 | 20 |
20 | 21 |
21 class InstrumentationParser(object): | 22 class InstrumentationParser(object): |
22 | 23 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 may be None if no instrumentation result was found in the output. | 88 may be None if no instrumentation result was found in the output. |
88 | 89 |
89 Raises: | 90 Raises: |
90 AssertionError if attempting to get the instrumentation result before | 91 AssertionError if attempting to get the instrumentation result before |
91 exhausting |IterStatus| first. | 92 exhausting |IterStatus| first. |
92 """ | 93 """ |
93 assert self._bundle is not None, ( | 94 assert self._bundle is not None, ( |
94 'The IterStatus generator must be exhausted before reading the final' | 95 'The IterStatus generator must be exhausted before reading the final' |
95 ' instrumentation result.') | 96 ' instrumentation result.') |
96 return self._code, self._bundle | 97 return self._code, self._bundle |
OLD | NEW |