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..66caf9fd8d5a997d12f2dcd01b6b69e57f0442a9 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 |
@@ -458,6 +463,33 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
}) |
return inflated_tests |
+ def GenerateMultiTestResult(self, errors, statuses): |
jbudorick
2015/01/20 15:39:03
Does this need |self|? It looks like it can be a @
rnephew (Wrong account)
2015/01/20 16:45:46
Done.
|
+ 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)) |
+ print 'batman' |
jbudorick
2015/01/20 15:39:03
the debugging statement we deserve, but not the on
rnephew (Wrong account)
2015/01/20 16:45:46
Done.
|
+ for error in errors: |
+ if re.search('Native Crash', error, re.IGNORECASE): |
+ results.append( |
+ base_test_result.BaseTestResult( |
+ 'Crash detected', base_test_result.ResultType.CRASH)) |
+ |
+ return results |
+ |
@staticmethod |
def ParseAmInstrumentRawOutput(raw_output): |
return ParseAmInstrumentRawOutput(raw_output) |