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