| ## FIXME: edit by 127 |
| # -*- Python -*- |
| |
| # Configuration file for the 'lit' test runner. |
| |
| import os |
| |
| import lit.util |
| import lit.formats |
| |
| # name: The name of this test suite. |
| config.name = 'MCLinker' |
| |
| # testFormat: The test format to use to interpret tests. |
| # |
| # For now we require '&&' between commands, until they get globally killed and |
| # the test runner updated. |
| config.test_format = lit.formats.ShTest(execute_external = True) |
| |
| # suffixes: A list of file extensions to treat as test files. |
| config.suffixes = ['.ll', '.ts'] |
| |
| # target_triple: Used by ShTest and TclTest formats for XFAIL checks. |
| config.target_triple = 'foo' |
| |
| |
| # Get the bindir, and add to PATH. |
| llvm_config = config.llvm_config |
| if not llvm_config: |
| lit_config.fatal('No llvm-config specific configuration available!') |
| |
| llvm_bindir = lit.util.capture([llvm_config, '--bindir']).strip() |
| llvm_obj_root = lit.util.capture([llvm_config, '--obj-root']).strip() |
| llvm_src_root = lit.util.capture([llvm_config, '--src-root']).strip() |
| llvm_build_bindir = os.path.join(llvm_obj_root, lit.util.capture([llvm_config, '--build-mode']).strip()+'/bin') |
| |
| path = os.path.pathsep.join((llvm_bindir, config.environment['PATH'])) |
| config.environment['PATH'] = path |
| path = os.path.pathsep.join((llvm_build_bindir, config.environment['PATH'])) |
| config.environment['PATH'] = path |
| |
| config.test_source_root = os.path.dirname(__file__) |
| config.test_exec_root = os.path.join(config.mclinker_obj_root, 'test') |
| |
| ### |
| |
| llc = config.llc |
| if not llc: |
| lit_config.fatal('No MCLinker specific configuration available!') |
| if not lit_config.quiet: |
| lit_config.note('using LLC: %r' % llc) |
| config.substitutions.append(('%LLC', llc)) |
| |
| mcld = config.mcld |
| if not mcld: |
| lit_config.fatal('No MCLinker specific configuration available!') |
| if not lit_config.quiet: |
| lit_config.note('using MCLinker: %r' % mcld) |
| config.substitutions.append(('%MCLinker', mcld)) |
| |
| fakeld = config.fakeld |
| if not fakeld: |
| lit_config.fatal('No MCLinker specific configuration available!') |
| if not lit_config.quiet: |
| lit_config.note('using Fake Linker: %r' % fakeld) |
| config.substitutions.append(('%FakeLinker', fakeld)) |
| |
| golden = config.golden_model_linker |
| if not golden: |
| golden = 'ld' |
| if not lit_config.quiet: |
| lit_config.note('golden model linker: %r' % golden) |
| config.substitutions.append(('%GOLDLD', golden)) |
| |