• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- Python -*-
2
3# Configuration file for the 'lit' test runner.
4
5import os
6import platform
7
8import lit.formats
9import lit.util
10
11# name: The name of this test suite.
12config.name = 'Polly-Unit'
13
14if not config.has_unittests:
15    raise SystemExit
16
17# suffixes: A list of file extensions to treat as test files.
18config.suffixes = []
19
20# test_source_root: The root path where tests are located.
21# test_exec_root: The root path where tests should be run.
22config.test_exec_root = os.path.join(config.polly_obj_root, 'unittests')
23config.test_source_root = config.test_exec_root
24
25# testFormat: The test format to use to interpret tests.
26config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
27
28# Propagate the temp directory. Windows requires this because it uses \Windows\
29# if none of these are present.
30if 'TMP' in os.environ:
31    config.environment['TMP'] = os.environ['TMP']
32if 'TEMP' in os.environ:
33    config.environment['TEMP'] = os.environ['TEMP']
34
35# Propagate path to symbolizer for ASan/MSan.
36for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
37    if symbolizer in os.environ:
38        config.environment[symbolizer] = os.environ[symbolizer]
39
40if platform.system() == 'Darwin':
41    shlibpath_var = 'DYLD_LIBRARY_PATH'
42elif platform.system() == 'Windows':
43    shlibpath_var = 'PATH'
44else:
45    shlibpath_var = 'LD_LIBRARY_PATH'
46
47# Point the dynamic loader at dynamic libraries in 'lib'.
48shlibpath = os.path.pathsep.join((config.llvm_libs_dir,
49                                 config.environment.get(shlibpath_var,'')))
50
51# Win32 seeks DLLs along %PATH%.
52if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
53    shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
54
55config.environment[shlibpath_var] = shlibpath
56