11 # Configuration file for the 'lit' test runner.
13 # name: The name of this test suite.
16 # testFormat: The test format to use to interpret tests.
18 # For now we require '&&' between commands, until they get globally killed and
19 # the test runner updated.
20 execute_external = platform.system() != 'Windows'
21 config.test_format = lit.formats.ShTest(execute_external)
23 # suffixes: A list of file extensions to treat as test files.
24 config.suffixes = ['.ll']
26 # test_source_root: The root path where tests are located.
27 config.test_source_root = os.path.dirname(__file__)
29 # test_exec_root: The root path where tests should be run.
30 config.test_exec_root = os.path.join(config.polly_obj_root, 'test')
32 # Tweak the PATH to include the tools dir and the scripts dir.
33 base_paths = [config.llvm_tools_dir, config.environment['PATH']]
34 path = os.path.pathsep.join(base_paths + config.extra_paths)
35 config.environment['PATH'] = path
37 path = os.path.pathsep.join((config.llvm_libs_dir,
38 config.environment.get('LD_LIBRARY_PATH','')))
39 config.environment['LD_LIBRARY_PATH'] = path
41 # opt knows whether it is compiled with -DNDEBUG.
44 opt_cmd = subprocess.Popen([os.path.join(config.llvm_tools_dir, 'opt'), '-version'],
45 stdout = subprocess.PIPE,
46 env=config.environment)
48 print("Could not find opt in " + config.llvm_tools_dir)
51 if re.search(r'with assertions', opt_cmd.stdout.read().decode('ascii')):
52 config.available_features.add('asserts')
56 llvm_config_cmd = subprocess.Popen([os.path.join(
57 config.llvm_tools_dir,
60 stdout = subprocess.PIPE,
61 env=config.environment)
63 print("Could not find llvm-config in " + config.llvm_tools_dir)
66 if re.search(r'NVPTX', llvm_config_cmd.stdout.read().decode('ascii')):
67 config.available_features.add('nvptx-registered-target')
68 llvm_config_cmd.wait()