10 # Configuration file for the 'lit' test runner.
12 # name: The name of this test suite.
13 config.name = 'Polly - isl unit tests'
15 # testFormat: The test format to use to interpret tests.
17 # For now we require '&&' between commands, until they get globally killed and
18 # the test runner updated.
20 # TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
21 # See https://github.com/llvm/llvm-project/issues/106636 for more details.
23 # We prefer the lit internal shell which provides a better user experience on failures
24 # unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
26 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
28 use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
30 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
32 # suffixes: A list of file extensions to treat as test files.
33 config.suffixes = ['.sh']
35 # test_source_root: The root path where tests are located.
36 config.test_source_root = os.path.dirname(__file__)
38 # test_exec_root: The root path where tests should be run.
39 polly_obj_root = getattr(config, 'polly_obj_root', None)
40 if polly_obj_root is not None:
41 config.test_exec_root = os.path.join(polly_obj_root, 'test')
43 # Set llvm_{src,obj}_root for use by others.
44 config.llvm_src_root = getattr(config, 'llvm_src_root', None)
45 config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
47 # Tweak the PATH to ensure that built files are the ones executed.
48 bin_dir = getattr(config, 'bin_dir', None)
50 lit_config.fatal('No executable dir set!')
51 path = os.path.pathsep.join((bin_dir, config.environment['PATH']))
52 config.environment['PATH'] = path
54 config.environment['srcdir'] = os.path.join(config.test_source_root,
55 '../../lib/External/isl')