Chromium Code Reviews| Index: build/android/test_package.py |
| diff --git a/build/android/test_package.py b/build/android/test_package.py |
| index e4b10e17a6102669280ca14fa1c22dec41b73c75..96d8312b507efda1d0abce92d65906f6ec084f30 100644 |
| --- a/build/android/test_package.py |
| +++ b/build/android/test_package.py |
| @@ -129,11 +129,13 @@ class TestPackage(object): |
| """ |
| ok_tests = [] |
| failed_tests = [] |
| + crashed_tests = [] |
| timed_out = False |
| overall_fail = False |
| re_run = re.compile('\[ RUN \] ?(.*)\r\n') |
| # APK tests rely on the END tag. |
| re_end = re.compile('\[ END \] ?(.*)\r\n') |
| + re_crash = re.compile('\[ CRASHED \](.*)\r\n') |
|
John Grabowski
2012/05/07 19:22:15
It seems illogical a test will announce it crashed
nilesh
2012/05/08 01:38:10
I am not sure I understand what you want here. Can
John Grabowski
2012/05/08 12:54:10
Sure.
At first glance it does not make sense that
nilesh
2012/05/08 22:18:43
Done.
|
| re_fail = re.compile('\[ FAILED \] ?(.*)\r\n') |
| re_runner_fail = re.compile('\[ RUNNER_FAILED \] ?(.*)\r\n') |
| re_ok = re.compile('\[ OK \] ?(.*)\r\n') |
| @@ -152,16 +154,22 @@ class TestPackage(object): |
| if self.dump_debug_info: |
| self.dump_debug_info.TakeScreenshot('_Test_Start_Run_') |
| full_test_name = p.match.group(1) |
| - found = p.expect([re_ok, re_fail, pexpect.EOF, pexpect.TIMEOUT], |
| + found = p.expect([re_ok, re_fail, re_crash, pexpect.EOF, pexpect.TIMEOUT], |
| timeout=self.timeout) |
| if found == 0: # re_ok |
| ok_tests += [BaseTestResult(full_test_name.replace('\r', ''), |
| p.before)] |
| continue |
| + if found == 2: # re_crash |
| + crashed_tests += [BaseTestResult(full_test_name.replace('\r', ''), |
| + p.before)] |
| + overall_fail = True |
| + break |
| + # The test failed. |
| failed_tests += [BaseTestResult(full_test_name.replace('\r', ''), |
| p.before)] |
| - if found >= 2: |
| - # The test crashed / bailed out (i.e., didn't print OK or FAIL). |
| + if found >= 3: |
| + # The test bailed out (i.e., didn't print OK or FAIL). |
| if found == 3: # pexpect.TIMEOUT |
| logging.error('Test terminated after %d second timeout.', |
| self.timeout) |
| @@ -177,5 +185,7 @@ class TestPackage(object): |
| '\npexpect.after: %s' |
| % (p.before, |
| p.after))] |
| - return TestResults.FromOkAndFailed(ok_tests, failed_tests, |
| - timed_out, overall_fail) |
| + # Create TestResults and return |
| + return TestResults.FromOkFailedAndCrashed(ok_tests, failed_tests, |
| + crashed_tests, timed_out, |
| + overall_fail) |