diff --git a/mobly/base_instrumentation_test.py b/mobly/base_instrumentation_test.py index 57134222..ce03fd6a 100644 --- a/mobly/base_instrumentation_test.py +++ b/mobly/base_instrumentation_test.py @@ -795,7 +795,7 @@ def _parse_method_block_line(self, instrumentation_block, line): instrumentation_block.set_key( _InstrumentationStructurePrefixes.RESULT, line ) - return self._parse_result_line( + return self._parse_result_block_line( self._transition_instrumentation_block( instrumentation_block, new_state=_InstrumentationBlockStates.RESULT, diff --git a/tests/mobly/base_instrumentation_test_test.py b/tests/mobly/base_instrumentation_test_test.py index fcf52fb4..a811bf66 100755 --- a/tests/mobly/base_instrumentation_test_test.py +++ b/tests/mobly/base_instrumentation_test_test.py @@ -760,6 +760,21 @@ def test_run_instrumentation_test_with_runner_setup_crash(self): instrumentation_output, expected_has_error=True ) + def test_run_instrumentation_test_with_crash_before_status_code(self): + instrumentation_output = """\ +INSTRUMENTATION_STATUS: class=com.my.package.test.BasicTest +INSTRUMENTATION_STATUS: test=crashTest +INSTRUMENTATION_RESULT: shortMsg=Process crashed. +INSTRUMENTATION_CODE: 0""" + expected_executed = [ + ('com.my.package.test.BasicTest#crashTest', signals.TestFailure), + ] + self.assert_run_instrumentation_test( + instrumentation_output, + expected_executed=expected_executed, + expected_has_error=True, + ) + def test_run_instrumentation_test_with_runner_teardown_crash(self): instrumentation_output = """\ INSTRUMENTATION_STATUS: numtests=1