| 1 |
# This testing configuration handles running the test suite against LLVM's |
| 2 |
# libc++abi using adb on Android. |
| 3 |
|
| 4 |
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') |
| 5 |
|
| 6 |
import re |
| 7 |
import site |
| 8 |
|
| 9 |
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) |
| 10 |
|
| 11 |
import libcxx.test.android |
| 12 |
import libcxx.test.config |
| 13 |
import libcxx.test.params |
| 14 |
|
| 15 |
config.substitutions.append(('%{flags}', |
| 16 |
'--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else '' |
| 17 |
)) |
| 18 |
config.substitutions.append(('%{compile_flags}', |
| 19 |
'-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' |
| 20 |
)) |
| 21 |
|
| 22 |
# The platform library is called "libc++.so" and the NDK library is called "libc++_shared.so". |
| 23 |
# Use LD_LIBRARY_PATH to find the libcxx shared object because older Bionic dynamic loaders |
| 24 |
# don't support rpath lookup. The Android libc++ shared library exports libc++abi, so we |
| 25 |
# don't need to link with -lc++abi. |
| 26 |
config.substitutions.append(('%{link_flags}', |
| 27 |
'-nostdlib++ -L %{lib} -l@LIBCXX_SHARED_OUTPUT_NAME@' |
| 28 |
)) |
| 29 |
config.substitutions.append(('%{exec}', |
| 30 |
'%{executor}' + |
| 31 |
' --job-limit-socket ' + libcxx.test.android.adb_job_limit_socket() + |
| 32 |
' --prepend-path-env LD_LIBRARY_PATH /data/local/tmp/libc++ --execdir %{temp} -- ' |
| 33 |
)) |
| 34 |
|
| 35 |
libcxx.test.config.configure( |
| 36 |
libcxx.test.params.DEFAULT_PARAMETERS, |
| 37 |
libcxx.test.features.DEFAULT_FEATURES, |
| 38 |
config, |
| 39 |
lit_config |
| 40 |
) |