blob: fba034ae4fce2eca5a81c2fdafa4419c411c8f7c [file] [log] [blame]
Alexey Samsonov59c33c02012-08-07 08:59:15 +00001# -*- 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
7import os
8
Daniel Dunbarbeadec42013-08-09 22:23:23 +00009import lit.formats
10
Alexey Samsonov59c33c02012-08-07 08:59:15 +000011# Setup test format
Alexey Samsonov0d925332013-01-30 12:18:49 +000012llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
13config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
Alexey Samsonov59c33c02012-08-07 08:59:15 +000014
15# Setup test suffixes.
16config.suffixes = []
17
Alexey Samsonov071cc9e2013-09-08 13:23:29 +000018# Tweak PATH to include llvm tools dir.
Zachary Turnerce92db12017-09-15 22:10:46 +000019llvm_tools_dir = config.llvm_tools_dir
Alexey Samsonov071cc9e2013-09-08 13:23:29 +000020if (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)
22path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
23config.environment['PATH'] = path
24
Alexey Samsonov59c33c02012-08-07 08:59:15 +000025# Propagate the temp directory. Windows requires this because it uses \Windows\
26# if none of these are present.
27if 'TMP' in os.environ:
28 config.environment['TMP'] = os.environ['TMP']
29if 'TEMP' in os.environ:
30 config.environment['TEMP'] = os.environ['TEMP']
Kuba Mracek245318c2017-01-20 00:25:01 +000031
32if config.host_os == 'Darwin':
Julian Lettner6eef7d02019-02-27 19:06:20 +000033 # Only run up to 3 processes that require shadow memory simultaneously on
34 # 64-bit Darwin. Using more scales badly and hogs the system due to
35 # inefficient handling of large mmap'd regions (terabytes) by the kernel.
36 lit_config.parallelism_groups["shadow-memory"] = 3
Kuba Mracek245318c2017-01-20 00:25:01 +000037
Reid Klecknerf6e857c2017-04-07 01:23:15 +000038 # 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.
Reid Kleckner78495ea2017-04-07 01:24:48 +000042 import site
Reid Klecknerf6e857c2017-04-07 01:23:15 +000043 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