xref: /aosp_15_r20/external/cronet/third_party/libc++/src/test/configs/apple-libc++-backdeployment.cfg.in (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Testing configuration for back-deployment against older Apple system libc++.
2#
3# Under this configuration, we compile and link all the test suite against the latest libc++,
4# however we run against the libc++ on a different platform. This emulates the workflow of
5# a developer building their application using recent tools but with the goal of deploying
6# on existing devices running an older OS (and hence an older dylib).
7
8import os, site
9site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
10import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
11
12lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
13
14BACKDEPLOYMENT_PARAMETERS = [
15    libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
16        actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
17        help="""
18        The simulated root of the system (for libc++) when running tests.
19
20        This should be a directory hierarchy under which the libc++ dylib can be found.
21        The dylib in that hierarchy is the one that will be used at runtime when running
22        the tests.
23        """),
24    libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
25        actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
26        help="""
27        The simulated root of the system (for libc++abi) when running tests.
28
29        This should be a directory hierarchy under which the libc++abi dylib can be found.
30        The dylib in that hierarchy is the one that will be used at runtime when running
31        the tests.
32        """),
33    libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
34        actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
35        help="""
36        The simulated root of the system (for libunwind) when running tests.
37
38        This should be a directory hierarchy under which the libunwind dylib can be found.
39        The dylib in that hierarchy is the one that will be used at runtime when running
40        the tests.
41        """),
42]
43
44config.substitutions.append(('%{flags}',
45    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
46))
47config.substitutions.append(('%{compile_flags}',
48    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
49))
50config.substitutions.append(('%{link_flags}',
51    '-nostdlib++ -L %{lib-dir} -lc++'
52))
53config.substitutions.append(('%{exec}',
54    '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
55))
56
57config.stdlib = 'apple-libc++'
58
59libcxx.test.config.configure(
60    libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
61    libcxx.test.features.DEFAULT_FEATURES,
62    config,
63    lit_config
64)
65