blob: 3198ab2c9539b5c696404bc7d73b2b72e8355176 [file] [log] [blame]
Daniel Dunbardb5fe932009-09-14 02:39:01 +00001# -*- Python -*-
2
3# Configuration file for the 'lit' test runner.
4
5import os
David L. Jones8804b792017-07-06 21:46:47 +00006import subprocess
Daniel Dunbardb5fe932009-09-14 02:39:01 +00007
Daniel Dunbar27c35d92013-08-09 16:22:05 +00008import lit.formats
9
Daniel Dunbardb5fe932009-09-14 02:39:01 +000010# name: The name of this test suite.
11config.name = 'LLVM-Unit'
12
Daniel Dunbarfb4fb6d2009-11-08 09:07:51 +000013# suffixes: A list of file extensions to treat as test files.
Daniel Dunbardb5fe932009-09-14 02:39:01 +000014config.suffixes = []
15
Chandler Carruthcdb63392016-03-12 03:03:31 +000016# is_early; Request to run this suite early.
17config.is_early = True
18
Daniel Dunbardb5fe932009-09-14 02:39:01 +000019# test_source_root: The root path where tests are located.
20# test_exec_root: The root path where tests should be run.
Zachary Turnera0f1ea32017-09-15 22:10:46 +000021config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests')
22config.test_source_root = config.test_exec_root
Daniel Dunbardb5fe932009-09-14 02:39:01 +000023
24# testFormat: The test format to use to interpret tests.
Zachary Turnera0f1ea32017-09-15 22:10:46 +000025config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
Daniel Dunbardb5fe932009-09-14 02:39:01 +000026
Michael J. Spencer44d392a2010-12-07 01:23:49 +000027# 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
Michal Gornyaf1df622018-12-31 13:48:12 +000034# 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
Alexey Samsonov3105d852013-04-04 07:41:00 +000039# 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
NAKAMURA Takumif8be6fb2014-07-04 05:11:55 +000044# Win32 seeks DLLs along %PATH%.
Zachary Turner8956eb92017-06-30 16:05:03 +000045if 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']))
NAKAMURA Takumif8be6fb2014-07-04 05:11:55 +000048
Andrew Ng8d4aa1d2017-05-08 08:55:38 +000049# 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']