| 1 | import lit.formats |
| 2 | import sys |
| 3 | |
| 4 | config.name = "LLVMFuzzer" |
| 5 | config.test_format = lit.formats.ShTest(True) |
| 6 | config.suffixes = ['.test'] |
| 7 | config.test_source_root = os.path.dirname(__file__) |
| 8 | |
| 9 | # Tweak PATH to include llvm tools dir and current exec dir. |
| 10 | llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) |
| 11 | if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): |
| 12 | lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) |
| 13 | path = os.path.pathsep.join((llvm_tools_dir, config.test_exec_root, |
| 14 | config.environment['PATH'])) |
| 15 | config.environment['PATH'] = path |
| 16 | |
| 17 | if config.has_lsan: |
| 18 | lit_config.note('lsan feature available') |
| 19 | config.available_features.add('lsan') |
| 20 | else: |
| 21 | lit_config.note('lsan feature unavailable') |
| 22 | |
| 23 | if sys.platform.startswith('linux'): |
| 24 | # Note the value of ``sys.platform`` is not consistent |
| 25 | # between python 2 and 3, hence the use of ``.startswith()``. |
| 26 | lit_config.note('linux feature available') |
| 27 | config.available_features.add('linux') |
| 28 | else: |
| 29 | lit_config.note('linux feature unavailable') |