]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - unittests/lit.common.unit.cfg
Vendor import of compiler-rt trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / unittests / lit.common.unit.cfg
1 # -*- Python -*-
2
3 # Configuration file for 'lit' test runner.
4 # This file contains common config setup rules for unit tests in various
5 # compiler-rt testsuites.
6
7 import os
8
9 import lit.formats
10
11 # Setup test format
12 llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
13 config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
14
15 # Setup test suffixes.
16 config.suffixes = []
17
18 # Tweak PATH to include llvm tools dir.
19 llvm_tools_dir = config.llvm_tools_dir
20 if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
21   lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
22 path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
23 config.environment['PATH'] = path
24
25 # Propagate the temp directory. Windows requires this because it uses \Windows\
26 # if none of these are present.
27 if 'TMP' in os.environ:
28     config.environment['TMP'] = os.environ['TMP']
29 if 'TEMP' in os.environ:
30     config.environment['TEMP'] = os.environ['TEMP']
31
32 if config.host_os == 'Darwin':
33   # Only run up to 3 64-bit sanitized processes simultaneously on Darwin.
34   # Using more scales badly and hogs the system due to inefficient handling
35   # of large mmap'd regions (terabytes) by the kernel.
36   lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
37
38   # The test config gets pickled and sent to multiprocessing workers, and that
39   # only works for code if it is stored at the top level of some module.
40   # Therefore, we have to put the code in a .py file, add it to path, and import
41   # it to store it in the config.
42   import site
43   site.addsitedir(os.path.dirname(__file__))
44   import lit_unittest_cfg_utils
45   config.darwin_sanitizer_parallelism_group_func = \
46     lit_unittest_cfg_utils.darwin_sanitizer_parallelism_group_func