Don Hinton | 3a58f67 | 2017-12-12 16:54:20 | [diff] [blame^] | 1 | # -*- Python -*- |
| 2 | |
| 3 | import os |
| 4 | import platform |
| 5 | import re |
| 6 | import subprocess |
| 7 | import tempfile |
| 8 | |
| 9 | import lit.formats |
| 10 | import lit.util |
| 11 | |
| 12 | from lit.llvm import llvm_config |
| 13 | from lit.llvm.subst import ToolSubst |
| 14 | from lit.llvm.subst import FindTool |
| 15 | |
| 16 | # Configuration file for the 'lit' test runner. |
| 17 | |
| 18 | # name: The name of this test suite. |
| 19 | config.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. |
| 25 | config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) |
| 26 | |
| 27 | # suffixes: A list of file extensions to treat as test files. |
| 28 | config.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. |
| 33 | config.excludes = ['Inputs'] |
| 34 | |
| 35 | # test_source_root: The root path where tests are located. |
| 36 | config.test_source_root = os.path.join(config.debuginfo_tests_src_root) |
| 37 | |
| 38 | # test_exec_root: The root path where tests should be run. |
| 39 | config.test_exec_root = config.debuginfo_tests_obj_root |
| 40 | |
| 41 | llvm_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 "". |
| 45 | if not hasattr(config, 'clang_src_dir'): |
| 46 | config.clang_src_dir = "" |
| 47 | llvm_config.use_clang() |
| 48 | |
| 49 | if 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 | |
| 54 | tool_dirs = [config.llvm_tools_dir] |
| 55 | |
| 56 | tools = [ |
| 57 | ToolSubst('%test_debuginfo', command=os.path.join( |
| 58 | config.debuginfo_tests_src_root, 'test_debuginfo.pl')), |
| 59 | ] |
| 60 | |
| 61 | llvm_config.add_tool_substitutions(tools, tool_dirs) |
| 62 | |
| 63 | lit.util.usePlatformSdkOnDarwin(config, lit_config) |