(suite, arch, parent)
Factory method for making graph configuration objects.
Factory method for making graph configuration objects.
Factory method for making graph configuration objects .
def MakeGraphConfig(suite, arch, parent):
  """Factory method for making graph configuration objects."""
  if isinstance(parent, RunnableConfig):
    # Below a runnable can only be traces.
    return TraceConfig(suite, parent, arch)
  elif suite.get("main") is not None:
    # A main file makes this graph runnable. Empty strings are accepted.
    if suite.get("tests"):
      # This graph has subgraphs (traces).
      return RunnableConfig(suite, parent, arch)
    else:
      # This graph has no subgraphs, it's a leaf.
      return RunnableTraceConfig(suite, parent, arch)
  elif suite.get("generic"):
    # This is a generic suite definition. It is either a runnable executable
    # or has a main js file.
    return RunnableGenericConfig(suite, parent, arch)
  elif suite.get("tests"):
    # This is neither a leaf nor a runnable.
    return GraphConfig(suite, parent, arch)
  else:  # pragma: no cover
    raise Exception("Invalid suite configuration.")
def MakeGraphConfig ( suite , arch , parent ) : if isinstance ( parent , RunnableConfig ) : # Below a runnable can only be traces. return TraceConfig ( suite , parent , arch ) elif suite . get ( "main" ) is not None : # A main file makes this graph runnable. Empty strings are accepted. if suite . get ( "tests" ) : # This graph has subgraphs (traces). return RunnableConfig ( suite , parent , arch ) else : # This graph has no subgraphs, it's a leaf. return RunnableTraceConfig ( suite , parent , arch ) elif suite . get ( "generic" ) : # This is a generic suite definition. It is either a runnable executable # or has a main js file. return RunnableGenericConfig ( suite , parent , arch ) elif suite . get ( "tests" ) : # This is neither a leaf nor a runnable. return GraphConfig ( suite , parent , arch ) else : # pragma: no cover raise Exception ( "Invalid suite configuration." )