2009-09-14 10:39:01 +08:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
|
|
|
|
import os
|
2017-07-07 05:46:47 +08:00
|
|
|
import subprocess
|
2009-09-14 10:39:01 +08:00
|
|
|
|
2013-08-10 00:22:05 +08:00
|
|
|
import lit.formats
|
|
|
|
|
2009-09-14 10:39:01 +08:00
|
|
|
# name: The name of this test suite.
|
|
|
|
config.name = 'LLVM-Unit'
|
|
|
|
|
2009-11-08 17:07:51 +08:00
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
2009-09-14 10:39:01 +08:00
|
|
|
config.suffixes = []
|
|
|
|
|
2016-03-12 11:03:31 +08:00
|
|
|
# is_early; Request to run this suite early.
|
|
|
|
config.is_early = True
|
|
|
|
|
2009-09-14 10:39:01 +08:00
|
|
|
# test_source_root: The root path where tests are located.
|
|
|
|
# test_exec_root: The root path where tests should be run.
|
2017-09-16 06:10:46 +08:00
|
|
|
config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests')
|
|
|
|
config.test_source_root = config.test_exec_root
|
2009-09-14 10:39:01 +08:00
|
|
|
|
|
|
|
# testFormat: The test format to use to interpret tests.
|
2017-09-16 06:10:46 +08:00
|
|
|
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
|
2009-09-14 10:39:01 +08:00
|
|
|
|
2010-12-07 09:23:49 +08:00
|
|
|
# Propagate the temp directory. Windows requires this because it uses \Windows\
|
|
|
|
# if none of these are present.
|
|
|
|
if 'TMP' in os.environ:
|
|
|
|
config.environment['TMP'] = os.environ['TMP']
|
|
|
|
if 'TEMP' in os.environ:
|
|
|
|
config.environment['TEMP'] = os.environ['TEMP']
|
|
|
|
|
2018-12-31 21:48:12 +08:00
|
|
|
# Propagate HOME as it can be used to override incorrect homedir in passwd
|
|
|
|
# that causes the tests to fail.
|
|
|
|
if 'HOME' in os.environ:
|
|
|
|
config.environment['HOME'] = os.environ['HOME']
|
|
|
|
|
2013-04-04 15:41:00 +08:00
|
|
|
# Propagate path to symbolizer for ASan/MSan.
|
|
|
|
for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
|
|
|
|
if symbolizer in os.environ:
|
|
|
|
config.environment[symbolizer] = os.environ[symbolizer]
|
|
|
|
|
2014-07-04 13:11:55 +08:00
|
|
|
# Win32 seeks DLLs along %PATH%.
|
2017-07-01 00:05:03 +08:00
|
|
|
if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
|
|
|
|
config.environment['PATH'] = os.path.pathsep.join((
|
|
|
|
config.shlibdir, config.environment['PATH']))
|
2014-07-04 13:11:55 +08:00
|
|
|
|
2017-05-08 16:55:38 +08:00
|
|
|
# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
|
|
|
|
if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
|
|
|
|
config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
|