llvm-project/libcxxabi/test/configs/llvm-libc++abi-android.cfg.in
tynasello-google 13fe07d670
[libc++] Expand Android libc++ test config files (#142846)
Parameterize (and rename) existing libc++/libc++abi test configuration
files for the Android NDK to work for both the NDK and platform.

Android LLVM downstream seeks to test libc++ for both the NDK and
platform build (currently only testing the NDK), which will use almost
identical test configuration files. The only difference is the name of
the libc++ shared object used. Because of this we parameterize the
current test files (for both libc++ and libc++abi) with the existing
LIBCXX_SHARED_OUTPUT_NAME cmake variable, and rename the file
accordingly.
2025-06-12 11:39:28 -04:00

41 lines
1.5 KiB
INI

# This testing configuration handles running the test suite against LLVM's
# libc++abi using adb on Android.
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
import re
import site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.android
import libcxx.test.config
import libcxx.test.params
config.substitutions.append(('%{flags}',
'--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
))
# The platform library is called "libc++.so" and the NDK library is called "libc++_shared.so".
# Use LD_LIBRARY_PATH to find the libcxx shared object because older Bionic dynamic loaders
# don't support rpath lookup. The Android libc++ shared library exports libc++abi, so we
# don't need to link with -lc++abi.
config.substitutions.append(('%{link_flags}',
'-nostdlib++ -L %{lib} -l@LIBCXX_SHARED_OUTPUT_NAME@'
))
config.substitutions.append(('%{exec}',
'%{executor}' +
' --job-limit-socket ' + libcxx.test.android.adb_job_limit_socket() +
' --prepend-path-env LD_LIBRARY_PATH /data/local/tmp/libc++ --execdir %T -- '
))
libcxx.test.config.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)