Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/lit.cfg.py
# -*- Python -*- | # -*- Python -*- | ||||
# Configuration file for the 'lit' test runner. | # Configuration file for the 'lit' test runner. | ||||
import os | import os | ||||
import sys | import sys | ||||
import re | import re | ||||
import platform | import platform | ||||
import subprocess | import subprocess | ||||
import lit.util | import lit.util | ||||
import lit.formats | import lit.formats | ||||
from lit.llvm import llvm_config | from lit.llvm import llvm_config | ||||
from lit.llvm.subst import FindTool | from lit.llvm.subst import FindTool | ||||
from lit.llvm.subst import ToolSubst | from lit.llvm.subst import ToolSubst | ||||
# name: The name of this test suite. | # name: The name of this test suite. Append shadow scale value if it | ||||
# is non-default. | |||||
if config.asan_test_shadow_scale != '3': | |||||
config.name = 'LLVM-Scale%s' % config.asan_test_shadow_scale | |||||
else: | |||||
config.name = 'LLVM' | config.name = 'LLVM' | ||||
# testFormat: The test format to use to interpret tests. | # testFormat: The test format to use to interpret tests. | ||||
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) | config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) | ||||
# suffixes: A list of file extensions to treat as test files. This is overriden | # suffixes: A list of file extensions to treat as test files. This is overriden | ||||
# by individual lit.local.cfg files in the test subdirectories. | # by individual lit.local.cfg files in the test subdirectories. | ||||
config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s', '.mir'] | config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s', '.mir'] | ||||
# excludes: A list of directories to exclude from the testsuite. The 'Inputs' | # excludes: A list of directories to exclude from the testsuite. The 'Inputs' | ||||
# subdirectories contain auxiliary inputs for various tests in their parent | # subdirectories contain auxiliary inputs for various tests in their parent | ||||
# directories. | # directories. | ||||
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] | config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] | ||||
# test_source_root: The root path where tests are located. | # test_source_root: The root path where tests are located. | ||||
config.test_source_root = os.path.dirname(__file__) | config.test_source_root = os.path.dirname(__file__) | ||||
# test_exec_root: The root path where tests should be run. | |||||
config.test_exec_root = os.path.join(config.llvm_obj_root, 'test') | |||||
# Tweak the PATH to include the tools dir. | # Tweak the PATH to include the tools dir. | ||||
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) | llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) | ||||
# Propagate some variables from the host environment. | # Propagate some variables from the host environment. | ||||
llvm_config.with_system_environment( | llvm_config.with_system_environment( | ||||
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']) | ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']) | ||||
Show All 39 Lines | |||||
llvm_config.use_default_substitutions() | llvm_config.use_default_substitutions() | ||||
# Add site-specific substitutions. | # Add site-specific substitutions. | ||||
config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir)) | config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir)) | ||||
config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) | config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) | ||||
config.substitutions.append(('%exeext', config.llvm_exe_ext)) | config.substitutions.append(('%exeext', config.llvm_exe_ext)) | ||||
config.substitutions.append(('%host_cc', config.host_cc)) | config.substitutions.append(('%host_cc', config.host_cc)) | ||||
if config.asan_shadow_scale == config.asan_test_shadow_scale: | |||||
config.substitutions.append(('%opt_asan', 'opt')) | |||||
else: | |||||
config.substitutions.append(('%opt_asan', | |||||
'opt -asan-mapping-scale %s' % | |||||
config.asan_test_shadow_scale)) | |||||
config.substitutions.append(('%scale', config.asan_test_shadow_scale)) | |||||
lli_args = [] | lli_args = [] | ||||
# The target triple used by default by lli is the process target triple (some | # The target triple used by default by lli is the process target triple (some | ||||
# triple appropriate for generating code for the current process) but because | # triple appropriate for generating code for the current process) but because | ||||
# we don't support COFF in MCJIT well enough for the tests, force ELF format on | # we don't support COFF in MCJIT well enough for the tests, force ELF format on | ||||
# Windows. FIXME: the process target triple should be used here, but this is | # Windows. FIXME: the process target triple should be used here, but this is | ||||
# difficult to obtain on Windows. | # difficult to obtain on Windows. | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |