Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 1 | # -*- Python -*- |
| 2 | |
| 3 | # Configuration file for the 'lit' test runner. |
| 4 | |
| 5 | import os |
David L. Jones | 8804b79 | 2017-07-06 21:46:47 +0000 | [diff] [blame] | 6 | import subprocess |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 7 | |
Daniel Dunbar | 27c35d9 | 2013-08-09 16:22:05 +0000 | [diff] [blame] | 8 | import lit.formats |
| 9 | |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 10 | # name: The name of this test suite. |
| 11 | config.name = 'LLVM-Unit' |
| 12 | |
Daniel Dunbar | fb4fb6d | 2009-11-08 09:07:51 +0000 | [diff] [blame] | 13 | # suffixes: A list of file extensions to treat as test files. |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 14 | config.suffixes = [] |
| 15 | |
Chandler Carruth | cdb6339 | 2016-03-12 03:03:31 +0000 | [diff] [blame] | 16 | # is_early; Request to run this suite early. |
| 17 | config.is_early = True |
| 18 | |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 19 | # test_source_root: The root path where tests are located. |
| 20 | # test_exec_root: The root path where tests should be run. |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 21 | config.test_exec_root = os.path.join(config.llvm_obj_root, 'unittests') |
| 22 | config.test_source_root = config.test_exec_root |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 23 | |
| 24 | # testFormat: The test format to use to interpret tests. |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 25 | config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests') |
Daniel Dunbar | db5fe93 | 2009-09-14 02:39:01 +0000 | [diff] [blame] | 26 | |
Michael J. Spencer | 44d392a | 2010-12-07 01:23:49 +0000 | [diff] [blame] | 27 | # Propagate the temp directory. Windows requires this because it uses \Windows\ |
| 28 | # if none of these are present. |
| 29 | if 'TMP' in os.environ: |
| 30 | config.environment['TMP'] = os.environ['TMP'] |
| 31 | if 'TEMP' in os.environ: |
| 32 | config.environment['TEMP'] = os.environ['TEMP'] |
| 33 | |
Michal Gorny | af1df62 | 2018-12-31 13:48:12 +0000 | [diff] [blame] | 34 | # Propagate HOME as it can be used to override incorrect homedir in passwd |
| 35 | # that causes the tests to fail. |
| 36 | if 'HOME' in os.environ: |
| 37 | config.environment['HOME'] = os.environ['HOME'] |
| 38 | |
Alexey Samsonov | 3105d85 | 2013-04-04 07:41:00 +0000 | [diff] [blame] | 39 | # Propagate path to symbolizer for ASan/MSan. |
| 40 | for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']: |
| 41 | if symbolizer in os.environ: |
| 42 | config.environment[symbolizer] = os.environ[symbolizer] |
| 43 | |
NAKAMURA Takumi | f8be6fb | 2014-07-04 05:11:55 +0000 | [diff] [blame] | 44 | # Win32 seeks DLLs along %PATH%. |
Zachary Turner | 8956eb9 | 2017-06-30 16:05:03 +0000 | [diff] [blame] | 45 | if 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 Takumi | f8be6fb | 2014-07-04 05:11:55 +0000 | [diff] [blame] | 48 | |
Andrew Ng | 8d4aa1d | 2017-05-08 08:55:38 +0000 | [diff] [blame] | 49 | # Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate. |
| 50 | if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ: |
| 51 | config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE'] |