ios/build/bots/scripts/xctest_utils.py
def _ProcessLine(self, line):
    """Parses the line and changes the state of parsed tests accordingly.

    Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
    """

    # Is it a line declaring end of all tests?
    succeeded = self._test_execute_succeeded.match(line)
    failed = self._test_execute_failed.match(line)
    if succeeded or failed:
      self.completed = True
      self._current_test = ''
      return

    # Is it a line declaring a system alert is shown on the device?
    results = self._system_alert_present_message.search(line)
    if results:
      self.system_alert_present = True
      self._current_test = ''
      return

    # Is it the start of a test?
    results = self._test_start.match(line)
    if results:
      if self._current_test:
        if self._test_status[self._current_test][0] == 'started':
          self._test_status[self._current_test] = (
              'timeout', self._failure_description)
          self._result_collection.add_test_result(
              TestResult(
                  self._current_test,
                  TestStatus.ABORT,
                  test_log='\n'.join(self._failure_description)))
      test_name = '%s/%s' % (results.group(1), results.group(2))
      self._test_status[test_name] = ('started', ['Did not complete.'])
      self._current_test = test_name
      if self.retrying_failed:
        self._failure_description = self._test_status[test_name][1]
        self._failure_description.extend(['', 'RETRY OUTPUT:', ''])
      else:
        self._failure_description = []
      return

    # Is it a test success line?
    results = self._test_ok.match(line)
    if results:
      test_name = '%s/%s' % (results.group(1), results.group(2))
      status = self._StatusOfTest(test_name)
      if status != 'started':
        self._RecordError(line, 'success while in status %s' % status)
      if self.retrying_failed:
        self._test_status[test_name] = ('warning', self._failure_description)
        # This is a passed result. Previous failures were reported in separate
        # TestResult objects.
        self._result_collection.add_test_result(
            TestResult(
                test_name,
                TestStatus.PASS,
                test_log='\n'.join(self._failure_description)))
      else:
        self._test_status[test_name] = ('OK', [])
        self._result_collection.add_test_result(
            TestResult(test_name, TestStatus.PASS))
      self._failure_description = []
      self._current_test = ''
      return

    # Is it a test failure line?
    results = self._test_fail.match(line)
    if results:
      test_name = '%s/%s' % (results.group(1), results.group(2))
      status = self._StatusOfTest(test_name)
      if status not in ('started', 'failed', 'timeout'):
        self._RecordError(line, 'failure while in status %s' % status)
      if self._current_test != test_name:
        if self._current_test:
          self._RecordError(
              line,
              '%s failure while in test %s' % (test_name, self._current_test))
        return
      # Don't overwrite the failure description when a failing test is listed a
      # second time in the summary, or if it was already recorded as timing
      # out.
      if status not in ('failed', 'timeout'):
        self._test_status[test_name] = ('failed', self._failure_description)
      # Add to |test_results| regardless whether the test ran before.
      self._result_collection.add_test_result(
          TestResult(
              test_name,
              TestStatus.FAIL,
              test_log='\n'.join(self._failure_description)))
      self._failure_description = []
      self._current_test = ''
      return

    # Is it the start of the retry tests?
    results = self._retry_message.match(line)
    if results:
      self.retrying_failed = True
      return

    # Random line: if we're in a test, collect it for the failure description.
    # Tests may run simultaneously, so this might be off, but it's worth a try.
    # This also won't work if a test times out before it begins running.
    if self._current_test:
      self._failure_description.append(line)
Parses the line and changes the state of parsed tests accordingly.

    Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
    
Parses the line and changes the state of parsed tests accordingly.
Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
Parses the line and changes the state of parsed tests accordingly . Will recognize newly started tests OK or FAILED statuses timeouts etc .
def _ProcessLine(self, line):
    succeeded = self._test_execute_succeeded.match(line)
    failed = self._test_execute_failed.match(line)
    if succeeded or failed:
      self.completed = True
      self._current_test = ''
      return
    results = self._system_alert_present_message.search(line)
    if results:
      self.system_alert_present = True
      self._current_test = ''
      return
    results = self._test_start.match(line)
    if results:
      if self._current_test:
        if self._test_status[self._current_test][0] == 'started':
          self._test_status[self._current_test] = (
              'timeout', self._failure_description)
          self._result_collection.add_test_result(
              TestResult(
                  self._current_test,
                  TestStatus.ABORT,
                  test_log='\n'.join(self._failure_description)))
      test_name = '%s/%s' % (results.group(1), results.group(2))
      self._test_status[test_name] = ('started', ['Did not complete.'])
      self._current_test = test_name
      if self.retrying_failed:
        self._failure_description = self._test_status[test_name][1]
        self._failure_description.extend(['', 'RETRY OUTPUT:', ''])
      else:
        self._failure_description = []
      return
    results = self._test_ok.match(line)
    if results:
      test_name = '%s/%s' % (results.group(1), results.group(2))
      status = self._StatusOfTest(test_name)
      if status != 'started':
        self._RecordError(line, 'success while in status %s' % status)
      if self.retrying_failed:
        self._test_status[test_name] = ('warning', self._failure_description)
        self._result_collection.add_test_result(
            TestResult(
                test_name,
                TestStatus.PASS,
                test_log='\n'.join(self._failure_description)))
      else:
        self._test_status[test_name] = ('OK', [])
        self._result_collection.add_test_result(
            TestResult(test_name, TestStatus.PASS))
      self._failure_description = []
      self._current_test = ''
      return
    results = self._test_fail.match(line)
    if results:
      test_name = '%s/%s' % (results.group(1), results.group(2))
      status = self._StatusOfTest(test_name)
      if status not in ('started', 'failed', 'timeout'):
        self._RecordError(line, 'failure while in status %s' % status)
      if self._current_test != test_name:
        if self._current_test:
          self._RecordError(
              line,
              '%s failure while in test %s' % (test_name, self._current_test))
        return
      if status not in ('failed', 'timeout'):
        self._test_status[test_name] = ('failed', self._failure_description)
      self._result_collection.add_test_result(
          TestResult(
              test_name,
              TestStatus.FAIL,
              test_log='\n'.join(self._failure_description)))
      self._failure_description = []
      self._current_test = ''
      return
    results = self._retry_message.match(line)
    if results:
      self.retrying_failed = True
      return
    if self._current_test:
      self._failure_description.append(line)
def _ProcessLine ( self , line ) : succeeded = self . _test_execute_succeeded . match ( line ) failed = self . _test_execute_failed . match ( line ) if succeeded or failed : self . completed = True self . _current_test = '' return results = self . _system_alert_present_message . search ( line ) if results : self . system_alert_present = True self . _current_test = '' return results = self . _test_start . match ( line ) if results : if self . _current_test : if self . _test_status [ self . _current_test ] [ 0 ] == 'started' : self . _test_status [ self . _current_test ] = ( 'timeout' , self . _failure_description ) self . _result_collection . add_test_result ( TestResult ( self . _current_test , TestStatus . ABORT , test_log = '\n' . join ( self . _failure_description ) ) ) test_name = '%s/%s' % ( results . group ( 1 ) , results . group ( 2 ) ) self . _test_status [ test_name ] = ( 'started' , [ 'Did not complete.' ] ) self . _current_test = test_name if self . retrying_failed : self . _failure_description = self . _test_status [ test_name ] [ 1 ] self . _failure_description . extend ( [ '' , 'RETRY OUTPUT:' , '' ] ) else : self . _failure_description = [ ] return results = self . _test_ok . match ( line ) if results : test_name = '%s/%s' % ( results . group ( 1 ) , results . group ( 2 ) ) status = self . _StatusOfTest ( test_name ) if status != 'started' : self . _RecordError ( line , 'success while in status %s' % status ) if self . retrying_failed : self . _test_status [ test_name ] = ( 'warning' , self . _failure_description ) self . _result_collection . add_test_result ( TestResult ( test_name , TestStatus . PASS , test_log = '\n' . join ( self . _failure_description ) ) ) else : self . _test_status [ test_name ] = ( 'OK' , [ ] ) self . _result_collection . add_test_result ( TestResult ( test_name , TestStatus . PASS ) ) self . _failure_description = [ ] self . _current_test = '' return results = self . _test_fail . match ( line ) if results : test_name = '%s/%s' % ( results . group ( 1 ) , results . group ( 2 ) ) status = self . _StatusOfTest ( test_name ) if status not in ( 'started' , 'failed' , 'timeout' ) : self . _RecordError ( line , 'failure while in status %s' % status ) if self . _current_test != test_name : if self . _current_test : self . _RecordError ( line , '%s failure while in test %s' % ( test_name , self . _current_test ) ) return if status not in ( 'failed' , 'timeout' ) : self . _test_status [ test_name ] = ( 'failed' , self . _failure_description ) self . _result_collection . add_test_result ( TestResult ( test_name , TestStatus . FAIL , test_log = '\n' . join ( self . _failure_description ) ) ) self . _failure_description = [ ] self . _current_test = '' return results = self . _retry_message . match ( line ) if results : self . retrying_failed = True return if self . _current_test : self . _failure_description . append ( line )
Parses the line and changes the state of parsed tests accordingly.
Parses the line and changes the state of parsed tests accordingly .
"""Parses the line and changes the state of parsed tests accordingly.

    Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
    """ # Is it a line declaring end of all tests? # Is it a line declaring a system alert is shown on the device? # Is it the start of a test? # Is it a test success line? # This is a passed result. Previous failures were reported in separate # TestResult objects. # Is it a test failure line? # Don't overwrite the failure description when a failing test is listed a # second time in the summary, or if it was already recorded as timing # out. # Add to |test_results| regardless whether the test ran before. # Is it the start of the retry tests? # Random line: if we're in a test, collect it for the failure description. # Tests may run simultaneously, so this might be off, but it's worth a try. # This also won't work if a test times out before it begins running.
self
line