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