blob: 6b47dd50d1d9ea4b5826830f4f88782c13941ab8 [file] [log] [blame]
Don Hinton3a58f672017-12-12 16:54:20 +00001# -*- Python -*-
2
3import os
4import platform
5import re
6import subprocess
7import tempfile
Vedant Kumarefab30c2018-08-04 00:02:48 +00008import commands
Don Hinton3a58f672017-12-12 16:54:20 +00009
10import lit.formats
11import lit.util
12
13from lit.llvm import llvm_config
14from lit.llvm.subst import ToolSubst
15from lit.llvm.subst import FindTool
16
17# Configuration file for the 'lit' test runner.
18
19# name: The name of this test suite.
20config.name = 'debuginfo-tests'
21
22# testFormat: The test format to use to interpret tests.
23#
24# For now we require '&&' between commands, until they get globally killed and
25# the test runner updated.
26config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
27
28# suffixes: A list of file extensions to treat as test files.
29config.suffixes = ['.c', '.cpp', '.m']
30
31# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
32# subdirectories contain auxiliary inputs for various tests in their parent
33# directories.
34config.excludes = ['Inputs']
35
36# test_source_root: The root path where tests are located.
37config.test_source_root = os.path.join(config.debuginfo_tests_src_root)
38
39# test_exec_root: The root path where tests should be run.
40config.test_exec_root = config.debuginfo_tests_obj_root
41
42llvm_config.use_default_substitutions()
43
44# clang_src_dir is not used by these tests, but is required by
45# use_clang(), so set it to "".
46if not hasattr(config, 'clang_src_dir'):
47 config.clang_src_dir = ""
48llvm_config.use_clang()
49
50if config.llvm_use_sanitizer:
51 # Propagate path to symbolizer for ASan/MSan.
52 llvm_config.with_system_environment(
53 ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
54
55tool_dirs = [config.llvm_tools_dir]
56
57tools = [
58 ToolSubst('%test_debuginfo', command=os.path.join(
59 config.debuginfo_tests_src_root, 'test_debuginfo.pl')),
60]
61
62llvm_config.add_tool_substitutions(tools, tool_dirs)
63
64lit.util.usePlatformSdkOnDarwin(config, lit_config)
Vedant Kumarefab30c2018-08-04 00:02:48 +000065
66if platform.system() == 'Darwin':
67 xcode_lldb_vers = commands.getoutput("xcrun lldb --version")
68 match = re.search('lldb-(\d+)', xcode_lldb_vers)
69 if match:
70 apple_lldb_vers = int(match.group(1))
71 if apple_lldb_vers < 1000:
72 config.available_features.add('apple-lldb-pre-1000')