2009-09-14 04:39:01 +02:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
|
|
|
|
import os
|
2017-07-06 23:46:47 +02:00
|
|
|
import subprocess
|
2009-09-14 04:39:01 +02:00
|
|
|
|
2013-08-09 18:22:05 +02:00
|
|
|
import lit.formats
|
|
|
|
|
2009-09-14 04:39:01 +02:00
|
|
|
# name: The name of this test suite.
|
|
|
|
config.name = 'LLVM-Unit'
|
|
|
|
|
2009-11-08 10:07:51 +01:00
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
2009-09-14 04:39:01 +02:00
|
|
|
config.suffixes = []
|
|
|
|
|
2016-03-12 04:03:31 +01:00
|
|
|
# is_early; Request to run this suite early.
|
|
|
|
config.is_early = True
|
|
|
|
|
2009-09-14 04:39:01 +02: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 00:10:46 +02:00
|
|
|
config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests')
|
|
|
|
config.test_source_root = config.test_exec_root
|
2009-09-14 04:39:01 +02:00
|
|
|
|
|
|
|
# testFormat: The test format to use to interpret tests.
|
2017-09-16 00:10:46 +02:00
|
|
|
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
|
2009-09-14 04:39:01 +02:00
|
|
|
|
2010-12-07 02:23:49 +01: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 14:48:12 +01: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 09:41:00 +02: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 07:11:55 +02:00
|
|
|
# Win32 seeks DLLs along %PATH%.
|
2017-06-30 18:05:03 +02: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 07:11:55 +02:00
|
|
|
|
2017-05-08 10:55:38 +02: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']
|