1import os 2 3import lit.util 4 5# python 2.7 backwards compatibility 6try: 7 from shlex import quote as shell_quote 8except ImportError: 9 from pipes import quote as shell_quote 10 11 12config.test_format = lit.formats.ShTest(execute_external=False) 13config.suffixes = ['.test'] 14 15clang_path = os.path.join(config.clang_tools_dir, 'clang') 16extra_args = '--clang ' + shell_quote(clang_path) 17opt_path = os.path.join(config.llvm_tools_dir, 'opt') 18extra_args += ' --opt ' + shell_quote(opt_path) 19script_path = os.path.join(config.llvm_src_root, 'utils', 20 'update_cc_test_checks.py') 21assert os.path.isfile(script_path) 22config.substitutions.append( 23 ('%update_cc_test_checks', "%s %s %s" % ( 24 shell_quote(config.python_executable), shell_quote(script_path), 25 extra_args))) 26config.substitutions.append( 27 ('%clang_tools_dir', shell_quote(config.clang_tools_dir))) 28