1# -*- Python -*-
2
3import platform
4
5import lit.formats
6
7config.name = "Extra Tools Unit Tests"
8config.suffixes = [] # Seems not to matter for google tests?
9
10# Test Source and Exec root dirs both point to the same directory where google
11# test binaries are built.
12
13config.test_source_root = config.extra_tools_obj_dir
14config.test_exec_root = config.test_source_root
15
16# All GoogleTests are named to have 'Tests' as their suffix. The '.' option is
17# a special value for GoogleTest indicating that it should look through the
18# entire testsuite recursively for tests (alternatively, one could provide a
19# ;-separated list of subdirectories).
20config.test_format = lit.formats.GoogleTest('.', 'Tests')
21
22if platform.system() == 'Darwin':
23    shlibpath_var = 'DYLD_LIBRARY_PATH'
24elif platform.system() == 'Windows':
25    shlibpath_var = 'PATH'
26else:
27    shlibpath_var = 'LD_LIBRARY_PATH'
28
29# Point the dynamic loader at dynamic libraries in 'lib'.
30shlibpath = os.path.pathsep.join((config.shlibdir, config.llvm_libs_dir,
31                                 config.environment.get(shlibpath_var,'')))
32
33# Win32 seeks DLLs along %PATH%.
34if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
35    shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
36
37config.environment[shlibpath_var] = shlibpath
38