3
# Configuration file for the 'lit' test runner.
5
# name: The name of this test suite.
8
# testFormat: The test format to use to interpret tests.
10
# For now we require '&&' between commands, until they get globally killed and
11
# the test runner updated.
12
config.test_format = lit.formats.ShTest(execute_external = True)
14
# suffixes: A list of file extensions to treat as test files.
15
config.suffixes = ['.c', '.cpp', '.m', '.mm']
17
# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
18
config.target_triple = 'foo'
22
# Discover the 'clang' and 'clangcc' to use.
27
# Determine which clang to use.
28
clang = os.getenv('CLANG')
30
# If the user set clang in the environment, definitely use that and don't
35
# Otherwise look in the path.
36
clang = lit.util.which('clang', PATH)
39
lit.fatal("couldn't find 'clang' program, try setting "
40
"CLANG in your environment")
44
def inferClangCC(clang, PATH):
45
clangcc = os.getenv('CLANGCC')
47
# If the user set clang in the environment, definitely use that and don't
52
# Otherwise try adding -cc since we expect to be looking in a build
54
if clang.endswith('.exe'):
55
clangccName = clang[:-4] + '-cc.exe'
57
clangccName = clang + '-cc'
58
clangcc = lit.util.which(clangccName, PATH)
60
# Otherwise ask clang.
61
res = lit.util.capture([clang, '-print-prog-name=clang-cc'])
63
if res and os.path.exists(res):
67
lit.fatal("couldn't find 'clang-cc' program, try setting "
68
"CLANGCC in your environment")
72
clang = inferClang(config.environment['PATH'])
74
lit.note('using clang: %r' % clang)
75
config.substitutions.append( (' clang ', ' ' + clang + ' ') )
77
clang_cc = inferClangCC(clang, config.environment['PATH'])
79
lit.note('using clang-cc: %r' % clang_cc)
80
config.substitutions.append( (' clang-cc ', ' ' + clang_cc + ' ') )