tools/nocompile_driver.py
def ProcessTestResult(resultfile, resultlog, test):
  """Interprets and logs the result of a test started by StartTest()

  Args:
    resultfile: File object for .cc file that results are written to.
    resultlog: File object for the log file.
    test: The dictionary from StartTest() to process.
  """
  proc = test['proc']
  proc.wait()
  (stdout, stderr) = ExtractTestOutputAndCleanup(test)

  if test['aborted_at'] != 0:
    FailTest(resultfile, test, "Compile timed out. Started %f ended %f." %
             (test['started_at'], test['aborted_at']))
    return

  if proc.poll() == 0:
    # Handle failure due to successful compile.
    FailTest(resultfile, test,
             'Unexpected successful compilation.',
             stdout, stderr)
    return
  else:
    # Check the output has the right expectations.  If there are no
    # expectations, then we just consider the output "matched" by default.
    if len(test['expectations']) == 0:
      PassTest(resultfile, resultlog, test)
      return

    # Otherwise test against all expectations.
    for regexp in test['expectations']:
      if (regexp.search(stdout) is not None or
          regexp.search(stderr) is not None):
        PassTest(resultfile, resultlog, test)
        return
    expectation_str = ', '.join(
        ["r'%s'" % regexp.pattern for regexp in test['expectations']])
    FailTest(resultfile, test,
             'Expectations [%s] did not match output.' % expectation_str,
             stdout, stderr)
    return
Interprets and logs the result of a test started by StartTest()

  Args:
    resultfile: File object for .cc file that results are written to.
    resultlog: File object for the log file.
    test: The dictionary from StartTest() to process.
  
Interprets and logs the result of a test started by StartTest()
Interprets and logs the result of a test started by StartTest ()
def ProcessTestResult(resultfile, resultlog, test):
  proc = test['proc']
  proc.wait()
  (stdout, stderr) = ExtractTestOutputAndCleanup(test)
  if test['aborted_at'] != 0:
    FailTest(resultfile, test, "Compile timed out. Started %f ended %f." %
             (test['started_at'], test['aborted_at']))
    return
  if proc.poll() == 0:
    FailTest(resultfile, test,
             'Unexpected successful compilation.',
             stdout, stderr)
    return
  else:
    if len(test['expectations']) == 0:
      PassTest(resultfile, resultlog, test)
      return
    for regexp in test['expectations']:
      if (regexp.search(stdout) is not None or
          regexp.search(stderr) is not None):
        PassTest(resultfile, resultlog, test)
        return
    expectation_str = ', '.join(
        ["r'%s'" % regexp.pattern for regexp in test['expectations']])
    FailTest(resultfile, test,
             'Expectations [%s] did not match output.' % expectation_str,
             stdout, stderr)
    return
def ProcessTestResult ( resultfile , resultlog , test ) : proc = test [ 'proc' ] proc . wait ( ) ( stdout , stderr ) = ExtractTestOutputAndCleanup ( test ) if test [ 'aborted_at' ] != 0 : FailTest ( resultfile , test , "Compile timed out. Started %f ended %f." % ( test [ 'started_at' ] , test [ 'aborted_at' ] ) ) return if proc . poll ( ) == 0 : FailTest ( resultfile , test , 'Unexpected successful compilation.' , stdout , stderr ) return else : if len ( test [ 'expectations' ] ) == 0 : PassTest ( resultfile , resultlog , test ) return for regexp in test [ 'expectations' ] : if ( regexp . search ( stdout ) is not None or regexp . search ( stderr ) is not None ) : PassTest ( resultfile , resultlog , test ) return expectation_str = ', ' . join ( [ "r'%s'" % regexp . pattern for regexp in test [ 'expectations' ] ] ) FailTest ( resultfile , test , 'Expectations [%s] did not match output.' % expectation_str , stdout , stderr ) return
Interprets and logs the result of a test started by StartTest()
Interprets and logs the result of a test started by StartTest ()
"""Interprets and logs the result of a test started by StartTest()

  Args:
    resultfile: File object for .cc file that results are written to.
    resultlog: File object for the log file.
    test: The dictionary from StartTest() to process.
  """ # Handle failure due to successful compile. # Check the output has the right expectations.  If there are no # expectations, then we just consider the output "matched" by default. # Otherwise test against all expectations.
resultfile
File object for .cc file that results are written to.
File object for . cc file that results are written to .
resultlog
File object for the log file.
File object for the log file .
test
The dictionary from StartTest() to process.
The dictionary from StartTest () to process .