tools/fuchsia/comparative_tester/test_results.py
def ExtractTestInfo(line: str) -> Tuple[str, float]:
  """Deconstructs a line starting with OK, stating that the test finished
  successfully, and isolates the timing measurement as well as a descriptive
  string for the test

  Args:
    line (str): The line of output to attempt to destructure into name and time.

  Raises:
    Exception: In the event that it couldn't split on '(', because then it
        find the necessary timing measurement.
    Exception: in the event that it cannot find the ')' character in the output,
        because then it isn't capable of isolating the timing measurement.

  Returns:
    Tuple[str, float]: A tuple of the test name, and the amount of time it took
        to run.
  """

  # Trim off the [       OK ] part of the line
  trimmed = line.lstrip("[       OK ]").strip()
  try:
    test_name, rest = trimmed.split("(")  # Isolate the measurement
  except Exception as e:
    err_text = "Could not extract the case name from {} because of error {}"\
               .format(trimmed, str(e))
    raise Exception(err_text)
  try:
    measure, _ = rest.split(")", 1)[0].split()
  except Exception as e:
    err_text = "Could not extract measure and units from {}\
                because of error {}".format(rest, str(e))
    raise Exception(err_text)
  return test_name.strip(), float(measure)
Deconstructs a line starting with OK, stating that the test finished
  successfully, and isolates the timing measurement as well as a descriptive
  string for the test

  Args:
    line (str): The line of output to attempt to destructure into name and time.

  Raises:
    Exception: In the event that it couldn't split on '(', because then it
        find the necessary timing measurement.
    Exception: in the event that it cannot find the ')' character in the output,
        because then it isn't capable of isolating the timing measurement.

  Returns:
    Tuple[str, float]: A tuple of the test name, and the amount of time it took
        to run.
  
Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test
Deconstructs a line starting with OK stating that the test finished successfully and isolates the timing measurement as well as a descriptive string for the test
def ExtractTestInfo(line: str) -> Tuple[str, float]:
  trimmed = line.lstrip("[       OK ]").strip()
  try:
    test_name, rest = trimmed.split("(")  
  except Exception as e:
    err_text = "Could not extract the case name from {} because of error {}"\
               .format(trimmed, str(e))
    raise Exception(err_text)
  try:
    measure, _ = rest.split(")", 1)[0].split()
  except Exception as e:
    err_text = "Could not extract measure and units from {}\
                because of error {}".format(rest, str(e))
    raise Exception(err_text)
  return test_name.strip(), float(measure)
def ExtractTestInfo ( line : str ) -> Tuple [ str , float ] : trimmed = line . lstrip ( "[       OK ]" ) . strip ( ) try : test_name , rest = trimmed . split ( "(" ) except Exception as e : err_text = "Could not extract the case name from {} because of error {}" . format ( trimmed , str ( e ) ) raise Exception ( err_text ) try : measure , _ = rest . split ( ")" , 1 ) [ 0 ] . split ( ) except Exception as e : err_text = "Could not extract measure and units from {}\
                because of error {}" . format ( rest , str ( e ) ) raise Exception ( err_text ) return test_name . strip ( ) , float ( measure )
Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test
Deconstructs a line starting with OK stating that the test finished successfully and isolates the timing measurement as well as a descriptive string for the test
"""Deconstructs a line starting with OK, stating that the test finished
  successfully, and isolates the timing measurement as well as a descriptive
  string for the test

  Args:
    line (str): The line of output to attempt to destructure into name and time.

  Raises:
    Exception: In the event that it couldn't split on '(', because then it
        find the necessary timing measurement.
    Exception: in the event that it cannot find the ')' character in the output,
        because then it isn't capable of isolating the timing measurement.

  Returns:
    Tuple[str, float]: A tuple of the test name, and the amount of time it took
        to run.
  """ # Trim off the [       OK ] part of the line # Isolate the measurement
A tuple of the test name, and the amount of time it took
to run.
A tuple of the test name and the amount of time it took to run .
Tuple[str, float]
In the event that it couldn't split on '(', because then it
find the necessary timing measurement.
In the event that it couldn ' t split on ' ( ' because then it find the necessary timing measurement .
Exception
in the event that it cannot find the ')' character in the output,
because then it isn't capable of isolating the timing measurement.
in the event that it cannot find the ' ) ' character in the output because then it isn ' t capable of isolating the timing measurement .
Exception
line
str
The line of output to attempt to destructure into name and time.
The line of output to attempt to destructure into name and time .