3 # Configuration file for the 'lit' test runner.
11 # name: The name of this test suite.
12 config.name = 'Polly-Unit'
14 if not config.has_unittests:
17 # suffixes: A list of file extensions to treat as test files.
20 # test_source_root: The root path where tests are located.
21 # test_exec_root: The root path where tests should be run.
22 config.test_exec_root = os.path.join(config.polly_obj_root, 'unittests')
23 config.test_source_root = config.test_exec_root
25 # testFormat: The test format to use to interpret tests.
26 config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
28 # Propagate the temp directory. Windows requires this because it uses \Windows\
29 # if none of these are present.
30 if 'TMP' in os.environ:
31 config.environment['TMP'] = os.environ['TMP']
32 if 'TEMP' in os.environ:
33 config.environment['TEMP'] = os.environ['TEMP']
35 # Propagate sanitizer options.
37 'ASAN_SYMBOLIZER_PATH',
38 'HWASAN_SYMBOLIZER_PATH',
39 'MSAN_SYMBOLIZER_PATH',
40 'TSAN_SYMBOLIZER_PATH',
41 'UBSAN_SYMBOLIZER_PATH',
49 config.environment[var] = os.environ[var]
51 if platform.system() == 'Darwin':
52 shlibpath_var = 'DYLD_LIBRARY_PATH'
53 elif platform.system() == 'Windows':
54 shlibpath_var = 'PATH'
56 shlibpath_var = 'LD_LIBRARY_PATH'
58 # Point the dynamic loader at dynamic libraries in 'lib'.
59 shlibpath = os.path.pathsep.join((config.llvm_libs_dir,
60 config.environment.get(shlibpath_var,'')))
62 # Win32 seeks DLLs along %PATH%.
63 if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
64 shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
66 config.environment[shlibpath_var] = shlibpath