brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 4b68f14 Raw
56 lines · plain
1# -*clang- Python -*-2 3import os4import platform5import re6 7import lit.formats8import lit.util9 10# Configuration file for the 'lit' test runner.11 12# name: The name of this test suite.13config.name = 'Polly - isl unit tests'14 15# testFormat: The test format to use to interpret tests.16#17# For now we require '&&' between commands, until they get globally killed and18# the test runner updated.19#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.22#23# We prefer the lit internal shell which provides a better user experience on failures24# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.25use_lit_shell = True26lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")27if lit_shell_env:28	use_lit_shell = lit.util.pythonize_bool(lit_shell_env)29 30config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)31 32# suffixes: A list of file extensions to treat as test files.33config.suffixes = ['.sh']34 35# test_source_root: The root path where tests are located.36config.test_source_root = os.path.dirname(__file__)37 38# test_exec_root: The root path where tests should be run.39polly_obj_root = getattr(config, 'polly_obj_root', None)40if polly_obj_root is not None:41    config.test_exec_root = os.path.join(polly_obj_root, 'test')42 43# Set llvm_{src,obj}_root for use by others.44config.llvm_src_root = getattr(config, 'llvm_src_root', None)45config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)46 47# Tweak the PATH to ensure that built files are the ones executed.48bin_dir = getattr(config, 'bin_dir', None)49if bin_dir is None:50    lit_config.fatal('No executable dir set!')51path = os.path.pathsep.join((bin_dir, config.environment['PATH']))52config.environment['PATH'] = path53 54config.environment['srcdir'] = os.path.join(config.test_source_root,55                                            '../../lib/External/isl')56