1# -*- Python -*-
2
3# Configuration file for the 'lit' test runner.
4
5import os
6import subprocess
7
8import lit.formats
9
10# name: The name of this test suite.
11config.name = 'LLVM-Unit'
12
13# suffixes: A list of file extensions to treat as test files.
14config.suffixes = []
15
16# is_early; Request to run this suite early.
17config.is_early = True
18
19# test_source_root: The root path where tests are located.
20# test_exec_root: The root path where tests should be run.
21config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests')
22config.test_source_root = config.test_exec_root
23
24# testFormat: The test format to use to interpret tests.
25config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
26
27# Propagate the temp directory. Windows requires this because it uses \Windows\
28# if none of these are present.
29if 'TMP' in os.environ:
30    config.environment['TMP'] = os.environ['TMP']
31if 'TEMP' in os.environ:
32    config.environment['TEMP'] = os.environ['TEMP']
33
34# Propagate HOME as it can be used to override incorrect homedir in passwd
35# that causes the tests to fail.
36if 'HOME' in os.environ:
37    config.environment['HOME'] = os.environ['HOME']
38
39# Propagate path to symbolizer for ASan/MSan.
40for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
41    if symbolizer in os.environ:
42        config.environment[symbolizer] = os.environ[symbolizer]
43
44# Win32 seeks DLLs along %PATH%.
45if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
46    config.environment['PATH'] = os.path.pathsep.join((
47            config.shlibdir, config.environment['PATH']))
48
49# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
50if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
51    config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
52