diff --git a/libcxx/test/configs/apple-libc++-shared.cfg.in b/libcxx/test/configs/apple-libc++-shared.cfg.in new file mode 100644 --- /dev/null +++ b/libcxx/test/configs/apple-libc++-shared.cfg.in @@ -0,0 +1,70 @@ +@AUTO_GEN_COMMENT@ + +@SERIALIZED_LIT_PARAMS@ + +# +# Testing configuration for Apple's system libc++. +# +# This configuration differs from a normal LLVM shared library configuration in +# that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library, +# since Apple's libc++ has an absolute install_name. +# +# We also don't use a per-target include directory layout, so we have only one +# include directory for the libc++ headers. +# + +LIBCXX_ROOT = "@LIBCXX_SOURCE_DIR@" +INSTALL_ROOT = "@CMAKE_BINARY_DIR@" +COMPILER = "@CMAKE_CXX_COMPILER@" +EXEC_ROOT = "@LIBCXX_BINARY_DIR@" +CMAKE_OSX_SYSROOT = "@CMAKE_OSX_SYSROOT@" +INCLUDE_DIR = "@LIBCXX_INSTALL_INCLUDE_DIR@" +LIBRARY_DIR = "@LIBCXX_INSTALL_LIBRARY_DIR@" + +import os +import pipes +import site +import sys +site.addsitedir(os.path.join(LIBCXX_ROOT, 'utils')) +import libcxx.test.features +import libcxx.test.format +import libcxx.test.newconfig +import libcxx.test.params + +# Configure basic properties of the test suite +config.name = 'libcxx-trunk-shared' +config.test_source_root = os.path.join(LIBCXX_ROOT, 'test') +config.test_format = libcxx.test.format.CxxStandardLibraryTest() +config.recursiveExpansionLimit = 10 +config.test_exec_root = EXEC_ROOT + +# Configure basic substitutions +runPy = os.path.join(LIBCXX_ROOT, 'utils', 'run.py') +config.substitutions.append(('%{cxx}', COMPILER)) +config.substitutions.append(('%{flags}', + '-isysroot {}'.format(CMAKE_OSX_SYSROOT) if CMAKE_OSX_SYSROOT else '' +)) +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -isystem {} -I {}'.format( + os.path.join(INSTALL_ROOT, INCLUDE_DIR), + os.path.join(LIBCXX_ROOT, 'test', 'support')) +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib++ -L {} -lc++'.format( + os.path.join(INSTALL_ROOT, LIBRARY_DIR)) +)) +config.substitutions.append(('%{exec}', + '{} {} --execdir %T --env DYLD_LIBRARY_PATH={} -- '.format( + pipes.quote(sys.executable), + pipes.quote(runPy), + pipes.quote(os.path.join(INSTALL_ROOT, LIBRARY_DIR))) +)) +config.substitutions.append(('%{install}', INSTALL_ROOT)) + +# Add parameters and features to the config +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) diff --git a/libcxx/utils/ci/apple-install-libcxx.sh b/libcxx/utils/ci/apple-install-libcxx.sh --- a/libcxx/utils/ci/apple-install-libcxx.sh +++ b/libcxx/utils/ci/apple-install-libcxx.sh @@ -121,7 +121,8 @@ -DCMAKE_INSTALL_NAME_DIR="/usr/lib" \ -DCMAKE_OSX_ARCHITECTURES="${arch}" \ -DLIBCXXABI_LIBRARY_VERSION="${version}" \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ + -DLIBCXX_TEST_CONFIG="${llvm_root}/libcxx/test/configs/apple-libc++-shared.cfg.in" ) xcrun --sdk "${sdk}" cmake --build "${build_dir}/${arch}" --target install-cxx install-cxxabi -- -v diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -362,7 +362,7 @@ x86_64-apple-system) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/apple-libc++-shared.cfg.in" check-cxx-cxxabi ;; x86_64-apple-system-noexceptions) @@ -370,7 +370,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/apple-libc++-shared.cfg.in" check-cxx-cxxabi ;; x86_64-apple-system-backdeployment-*)