• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import lit.formats
2import sys
3
4config.name = "LLVMFuzzer"
5config.test_format = lit.formats.ShTest(True)
6config.suffixes = ['.test']
7config.test_source_root = os.path.dirname(__file__)
8
9# Tweak PATH to include llvm tools dir and current exec dir.
10llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
11if (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)
13path = os.path.pathsep.join((llvm_tools_dir, config.test_exec_root,
14                             config.environment['PATH']))
15config.environment['PATH'] = path
16
17if config.has_dfsan:
18  lit_config.note('dfsan feature available')
19  config.available_features.add('dfsan')
20else:
21  lit_config.note('dfsan feature unavailable')
22
23if config.has_lsan:
24  lit_config.note('lsan feature available')
25  config.available_features.add('lsan')
26else:
27  lit_config.note('lsan feature unavailable')
28
29if sys.platform.startswith('linux'):
30  # Note the value of ``sys.platform`` is not consistent
31  # between python 2 and 3, hence the use of ``.startswith()``.
32  lit_config.note('linux feature available')
33  config.available_features.add('linux')
34else:
35  lit_config.note('linux feature unavailable')
36