6 # python 2.7 backwards compatibility
8 from shlex import quote as shell_quote
10 from pipes import quote as shell_quote
13 if config.standalone_build:
14 # These tests require the update_cc_test_checks.py script from the llvm
15 # source tree, so skip these tests if we are doing standalone builds.
16 # These tests are only relevant to developers working with the
17 # update_cc_test_checks.py tool; they don't provide any coverage
18 # for any of the clang source code.
19 config.unsupported = True
22 config.test_format = lit.formats.ShTest(execute_external=False)
23 config.suffixes = [".test"]
25 clang_path = os.path.join(config.clang_tools_dir, "clang")
26 extra_args = "--clang " + shell_quote(clang_path)
27 opt_path = os.path.join(config.llvm_tools_dir, "opt")
28 extra_args += " --opt " + shell_quote(opt_path)
29 # Specify an explicit default version in UTC tests, so that the --version
30 # embedded in UTC_ARGS does not change in all test expectations every time
31 # the default is bumped.
32 extra_args += " --version=1"
33 script_path = os.path.join(
34 config.llvm_src_root, "utils", "update_cc_test_checks.py"
36 assert os.path.isfile(script_path)
37 # Windows: llvm-lit.py, Linux: llvm-lit
38 if config.llvm_external_lit:
39 lit = config.llvm_external_lit
42 glob.glob(os.path.join(config.llvm_tools_dir, "llvm-lit*"))[0]
44 python = shell_quote(config.python_executable)
45 config.substitutions.append(
47 "%update_cc_test_checks",
48 "%s %s %s" % (python, shell_quote(script_path), extra_args),
51 config.substitutions.append(
52 ("%clang_tools_dir", shell_quote(config.clang_tools_dir))
54 config.substitutions.append(
57 "%s %s -Dclang_lit_site_cfg=%s -j1 -vv"
58 % (python, lit, shell_quote(config.clang_lit_site_cfg)),