Chromium Code Reviews| Index: build/android/pylib/instrumentation/instrumentation_test_instance.py |
| diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| index a87f81aeefbc75e9a0f99d6d049178de0758f52c..137d33ced6fb0acae31ce692b7a8d2307fb7d128 100644 |
| --- a/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| +++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| @@ -5,6 +5,7 @@ |
| import logging |
| import os |
| import pickle |
| +import re |
| import sys |
| from pylib import cmd_helper |
| @@ -270,6 +271,10 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
| self._flags.extend([flag for flag in stripped_lines if flag]) |
| @property |
| + def suite(self): |
| + return 'instrumentation' |
| + |
| + @property |
| def apk_under_test(self): |
| return self._apk_under_test |
| @@ -459,6 +464,33 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
| return inflated_tests |
| @staticmethod |
| + def GenerateMultiTestResult(errors, statuses): |
| + INSTR_STATUS_CODE_START = 1 |
| + results = [] |
| + skip_counter = 1 |
| + for status_code, bundle in statuses: |
| + if status_code != INSTR_STATUS_CODE_START: |
| + # TODO(rnephew): Make skipped tests still output test name. This is only |
| + # there to give skipped tests a unique name so they are counted |
| + if 'test_skipped' in bundle: |
| + test_name = str(skip_counter) |
| + skip_counter += 1 |
| + else: |
| + test_name = '%s#%s' % ( |
| + ''.join(bundle.get('class', [''])), |
| + ''.join(bundle.get('test', ['']))) |
| + |
| + results.append( |
| + GenerateTestResult(test_name, [(status_code, bundle)], 0, 0)) |
| + for error in errors: |
| + if re.search('Native Crash', error, re.IGNORECASE): |
|
jbudorick
2015/01/21 02:39:34
Compile the regex and save it in the constant in c
rnephew (Wrong account)
2015/01/21 16:13:12
Done.
|
| + results.append( |
| + base_test_result.BaseTestResult( |
| + 'Crash detected', base_test_result.ResultType.CRASH)) |
| + |
| + return results |
| + |
| + @staticmethod |
| def ParseAmInstrumentRawOutput(raw_output): |
| return ParseAmInstrumentRawOutput(raw_output) |