# -*- Python -*- # Configuration file for the 'lit' test runner. import os # name: The name of this test suite. config.name = 'KLEE' # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(execute_external=False) # suffixes: A list of file extensions to treat as test files # Note this can be overridden by lit.local.cfg files config.suffixes = ['.ll', '.c', '.cpp', '.pc'] # test_source_root: The root path where tests are located. config.test_source_root = os.path.dirname(__file__) # test_exec_root: The root path where tests should be run. klee_obj_root = getattr(config, 'klee_obj_root', None) if klee_obj_root is not None: config.test_exec_root = os.path.join(klee_obj_root, 'test') # Tweak the PATH to include the tool dir. if klee_obj_root is not None: klee_tools_dir = getattr(config, 'klee_tools_dir', None) if not klee_tools_dir: lit.fatal('No KLEE tools dir set!') # Check LLVM tool directory llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) if not llvm_tools_dir: lit.fatal('No LLVM tool directory set!') path = os.path.pathsep.join((llvm_tools_dir, klee_tools_dir, config.environment['PATH'] )) config.environment['PATH'] = path # Propogate 'HOME' through the environment. config.environment['HOME'] = os.environ['HOME'] config.environment['PWD'] = os.environ['PWD'] # Check that the object root is known. if config.test_exec_root is None: lit.fatal('test execution root not set!') # Add substitutions from lit.site.cfg subs = [ 'llvmgcc', 'llvmgxx'] for name in subs: value = getattr(config, name, None) if value == None: lit.fatal('{0} is not set'.format(name)) config.substitutions.append( ('%' + name, value)) # FIXME: Give these proper paths. config.substitutions.append(('%kleaver', 'kleaver')) config.substitutions.append(('%klee', 'klee')) # LLVM < 3.0 doesn't Support %T directive if int(config.llvm_version_major) == 2: # This is a hack config.substitutions.append(('%T','Output'))