forked from OSchip/llvm-project
Recommit "[libc++] NFC: Simplify substitutions by using lit recursive substitutions"
This re-commitscd7f9751c3
, which was reverted in12f6b024f9
because it broke the LLVM `check-all` target. This commit addresses the underlying issue by not setting the lit_config.recursiveExpansionLimit parameter of the libc++ test suite, which is otherwise picked up by other test suites in LLVM. Once we've settled on a fix for the underlying issue with lit_config.recursiveExpansionLimit, we can start using it again in libc++, but for now we can just work around it.
This commit is contained in:
parent
5227fa0c72
commit
05b04c685c
|
@ -1039,35 +1039,26 @@ class Configuration(object):
|
||||||
if self.target_info.is_darwin():
|
if self.target_info.is_darwin():
|
||||||
# Do not pass DYLD_LIBRARY_PATH to the compiler, linker, etc. as
|
# Do not pass DYLD_LIBRARY_PATH to the compiler, linker, etc. as
|
||||||
# these tools are not meant to exercise the just-built libraries.
|
# these tools are not meant to exercise the just-built libraries.
|
||||||
tool_env += 'env DYLD_LIBRARY_PATH="" '
|
tool_env += 'env DYLD_LIBRARY_PATH=""'
|
||||||
|
|
||||||
sub = self.config.substitutions
|
sub = self.config.substitutions
|
||||||
cxx_path = tool_env + pipes.quote(self.cxx.path)
|
|
||||||
# Configure compiler substitutions
|
# Configure compiler substitutions
|
||||||
sub.append(('%{cxx}', cxx_path))
|
sub.append(('%{cxx}', '{} {}'.format(tool_env, pipes.quote(self.cxx.path))))
|
||||||
sub.append(('%{libcxx_src_root}', self.libcxx_src_root))
|
sub.append(('%{libcxx_src_root}', self.libcxx_src_root))
|
||||||
# Configure flags substitutions
|
# Configure flags substitutions
|
||||||
flags_str = ' '.join([pipes.quote(f) for f in self.cxx.flags])
|
sub.append(('%{flags}', ' '.join(map(pipes.quote, self.cxx.flags))))
|
||||||
compile_flags_str = ' '.join([pipes.quote(f) for f in self.cxx.compile_flags])
|
sub.append(('%{compile_flags}', ' '.join(map(pipes.quote, self.cxx.compile_flags))))
|
||||||
link_flags_str = ' '.join([pipes.quote(f) for f in self.cxx.link_flags])
|
sub.append(('%{link_flags}', ' '.join(map(pipes.quote, self.cxx.link_flags))))
|
||||||
all_flags = '%s %s %s' % (flags_str, compile_flags_str, link_flags_str)
|
|
||||||
sub.append(('%{flags}', flags_str))
|
|
||||||
sub.append(('%{compile_flags}', compile_flags_str))
|
|
||||||
sub.append(('%{link_flags}', link_flags_str))
|
|
||||||
if self.cxx.isVerifySupported():
|
if self.cxx.isVerifySupported():
|
||||||
verify_str = ' ' + ' '.join(self.cxx.verify_flags) + ' '
|
sub.append(('%{verify}', ' '.join(self.cxx.verify_flags)))
|
||||||
sub.append(('%{verify}', verify_str))
|
# Add compile and build shortcuts
|
||||||
# Add compile and link shortcuts
|
sub.append(('%{compile}', '%{cxx} -o %t.o %s -c %{flags} %{compile_flags}'))
|
||||||
compile_str = (cxx_path + ' -o %t.o %s -c ' + flags_str
|
sub.append(('%{build}', '%{cxx} -o %t.exe %s %{flags} %{compile_flags} %{link_flags}'))
|
||||||
+ ' ' + compile_flags_str)
|
|
||||||
build_str = cxx_path + ' -o %t.exe %s ' + all_flags
|
|
||||||
if self.cxx.use_modules:
|
if self.cxx.use_modules:
|
||||||
sub.append(('%{build_module}', build_str))
|
sub.append(('%{build_module}', '%{build}'))
|
||||||
elif self.cxx.modules_flags is not None:
|
elif self.cxx.modules_flags is not None:
|
||||||
modules_str = ' '.join(self.cxx.modules_flags) + ' '
|
sub.append(('%{build_module}', '%{{build}} {}'.format(' '.join(self.cxx.modules_flags))))
|
||||||
sub.append(('%{build_module}', build_str + ' ' + modules_str))
|
|
||||||
sub.append(('%{compile}', compile_str))
|
|
||||||
sub.append(('%{build}', build_str))
|
|
||||||
# Configure exec prefix substitutions.
|
# Configure exec prefix substitutions.
|
||||||
# Configure run env substitution.
|
# Configure run env substitution.
|
||||||
codesign_ident = self.get_lit_conf('llvm_codesign_identity', '')
|
codesign_ident = self.get_lit_conf('llvm_codesign_identity', '')
|
||||||
|
@ -1077,13 +1068,11 @@ class Configuration(object):
|
||||||
'--dependencies %%{file_dependencies} --env %s -- ' % \
|
'--dependencies %%{file_dependencies} --env %s -- ' % \
|
||||||
(pipes.quote(sys.executable), pipes.quote(run_py),
|
(pipes.quote(sys.executable), pipes.quote(run_py),
|
||||||
codesign_ident, env_vars)
|
codesign_ident, env_vars)
|
||||||
run_str = exec_str + '%t.exe'
|
|
||||||
sub.append(('%{exec}', exec_str))
|
sub.append(('%{exec}', exec_str))
|
||||||
sub.append(('%{run}', run_str))
|
sub.append(('%{run}', '%{exec} %t.exe'))
|
||||||
# Configure not program substitutions
|
# Configure not program substitutions
|
||||||
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
|
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
|
||||||
not_str = '%s %s ' % (pipes.quote(sys.executable), pipes.quote(not_py))
|
sub.append(('%{not}', '{} {}'.format(pipes.quote(sys.executable), pipes.quote(not_py))))
|
||||||
sub.append(('%{not} ', not_str))
|
|
||||||
if self.get_lit_conf('libcxx_gdb'):
|
if self.get_lit_conf('libcxx_gdb'):
|
||||||
sub.append(('%{libcxx_gdb}', self.get_lit_conf('libcxx_gdb')))
|
sub.append(('%{libcxx_gdb}', self.get_lit_conf('libcxx_gdb')))
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,8 @@ class LibcxxTestFormat(object):
|
||||||
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir,
|
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir,
|
||||||
tmpBase)
|
tmpBase)
|
||||||
substitutions.append(('%{file_dependencies}', ' '.join(data_files)))
|
substitutions.append(('%{file_dependencies}', ' '.join(data_files)))
|
||||||
script = lit.TestRunner.applySubstitutions(script, substitutions)
|
script = lit.TestRunner.applySubstitutions(script, substitutions,
|
||||||
|
recursion_limit=10)
|
||||||
|
|
||||||
test_cxx = copy.deepcopy(self.cxx)
|
test_cxx = copy.deepcopy(self.cxx)
|
||||||
if is_fail_test:
|
if is_fail_test:
|
||||||
|
|
Loading…
Reference in New Issue