Factory method for making graph configuration objects.
(suite, parent)
| 636 | |
| 637 | |
| 638 | def GetGraphConfigClass(suite, parent): |
| 639 | """Factory method for making graph configuration objects.""" |
| 640 | if isinstance(parent, TraceConfig): |
| 641 | if suite.get("tests"): |
| 642 | return TraceConfig |
| 643 | return LeafTraceConfig |
| 644 | elif suite.get('main') is not None: |
| 645 | # A main file makes this graph runnable. Empty strings are accepted. |
| 646 | if suite.get('tests'): |
| 647 | # This graph has subgraphs (traces). |
| 648 | return RunnableConfig |
| 649 | else: |
| 650 | # This graph has no subgraphs, it's a leaf. |
| 651 | return RunnableLeafTraceConfig |
| 652 | elif suite.get('tests'): |
| 653 | # This is neither a leaf nor a runnable. |
| 654 | return GraphConfig |
| 655 | else: # pragma: no cover |
| 656 | raise Exception('Invalid suite configuration.' + str(suite)[:200]) |
| 657 | |
| 658 | |
| 659 | def BuildGraphConfigs(suite, parent, arch): |
no test coverage detected
searching dependent graphs…