Files
clang-p2996/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
Louis Dionne 78669c4185 [libc++][tests] Use CMake provided paths for includes and libdir instead of hardcoding them
In the new-style testing configurations, we were hardcoding paths to the
`include` and `lib` directories, which was incorrect but always went
unnoticed because the hardcoded values always happened to match the
actual value.

When using new-style configs with the bootstrapping build, this falls
appart -- and we never noticed this because the bootstrapping build was
still using old style configs.

This patch removes the %{install} substitution, which makes it too
tempting to hardcode installation paths, and it also switches the
bootstrapping build to actually using new-style configs like we
always intended to do.

Differential Revision: https://reviews.llvm.org/D121700
2022-03-16 12:35:06 -04:00

63 lines
2.7 KiB
INI

# Testing configuration for back-deployment against older Apple system libc++.
#
# Under this configuration, we compile and link all the test suite against the latest libc++,
# however we run against the libc++ on a different platform. This emulates the workflow of
# a developer building their application using recent tools but with the goal of deploying
# on existing devices running an older OS (and hence an older dylib).
import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
BACKDEPLOYMENT_PARAMETERS = [
libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
help="""
The simulated root of the system (for libc++) when running tests.
This should be a directory hierarchy under which the libc++ dylib can be found.
The dylib in that hierarchy is the one that will be used at runtime when running
the tests.
"""),
libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
help="""
The simulated root of the system (for libc++abi) when running tests.
This should be a directory hierarchy under which the libc++abi dylib can be found.
The dylib in that hierarchy is the one that will be used at runtime when running
the tests.
"""),
libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
help="""
The simulated root of the system (for libunwind) when running tests.
This should be a directory hierarchy under which the libunwind dylib can be found.
The dylib in that hierarchy is the one that will be used at runtime when running
the tests.
"""),
]
config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -I %{libcxx}/test/support'
))
config.substitutions.append(('%{link_flags}',
'-nostdlib++ -L %{lib} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
))
libcxx.test.newconfig.configure(
libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)