[libc++] Switch to the new testing configurations by default

We've been meaning to remove support for the legacy testing configuration
for a long time. This patch switches the default from the legacy config
to the appropriate new-style configuration based on a few hints.

We've been running with the new-style configuration for more than a year
in our CI, however it's possible that this will uncover issues with some
users that run the tests on platforms that we don't support yet with the
new-style configs. Unfortunately, there is no way to know about it other
than to land this patch and see whether anything breaks.

Differential Revision: https://reviews.llvm.org/D121632
This commit is contained in:
Louis Dionne 2022-03-14 14:23:38 -04:00
parent 164c7afaf5
commit d0af4276d6
3 changed files with 32 additions and 48 deletions

View File

@ -137,12 +137,31 @@ option(LIBCXX_ENABLE_INCOMPLETE_FEATURES
are new library features under development. These features don't guarantee
ABI stability nor the quality of completed library features. Vendors
shipping the library may want to disable this option." ON)
set(LIBCXX_TEST_CONFIG "legacy.cfg.in" CACHE STRING
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
elseif(MINGW)
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in")
elseif(WIN32) # clang-cl
if (LIBCXX_ENABLE_SHARED)
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in")
else()
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-clangcl.cfg.in")
endif()
else()
if (LIBCXX_ENABLE_SHARED)
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared.cfg.in")
else()
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static.cfg.in")
endif()
endif()
set(LIBCXX_TEST_CONFIG "${LIBCXX_DEFAULT_TEST_CONFIG}" CACHE STRING
"The path to the Lit testing configuration to use when running the tests.
If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.")
if (NOT IS_ABSOLUTE "${LIBCXX_TEST_CONFIG}")
set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBCXX_TEST_CONFIG}")
endif()
message(STATUS "Using libc++ testing configuration: ${LIBCXX_TEST_CONFIG}")
set(LIBCXX_TEST_PARAMS "" CACHE STRING
"A list of parameters to run the Lit test suite with.")

View File

@ -106,3 +106,9 @@ Build System Changes
libc++abi already installs its headers in the right location. However, vendors building
libc++ against alternate ABI libraries should make sure that their ABI library installs
its own headers.
- The legacy testing configuration is now deprecated and will be removed in the next release. For
most users, this should not have any impact. However, if you are testing libc++ in a configuration
or on a platform that used to be supported by the legacy testing configuration and isn't supported
by one of the configurations in ``libcxx/test/configs``, please reach out to the libc++ developers
to get your configuration supported officially.

View File

@ -192,7 +192,6 @@ check-generated-output)
generic-cxx03)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -200,7 +199,6 @@ generic-cxx03)
generic-cxx11)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -208,7 +206,6 @@ generic-cxx11)
generic-cxx14)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -216,7 +213,6 @@ generic-cxx14)
generic-cxx17)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -224,7 +220,6 @@ generic-cxx17)
generic-cxx20)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -232,7 +227,6 @@ generic-cxx20)
generic-cxx2b)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -240,7 +234,6 @@ generic-cxx2b)
generic-assertions)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -248,7 +241,6 @@ generic-assertions)
generic-debug-iterators)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -256,7 +248,6 @@ generic-debug-iterators)
generic-noexceptions)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -264,7 +255,6 @@ generic-noexceptions)
generic-modules)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -272,7 +262,6 @@ generic-modules)
generic-static)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in"
check-runtimes
;;
@ -280,8 +269,7 @@ generic-clang-13)
export CC=clang-13
export CXX=clang++-13
clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
@ -289,8 +277,7 @@ generic-clang-14)
export CC=clang-14
export CXX=clang++-14
clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
;;
@ -298,8 +285,7 @@ generic-gcc)
export CC=gcc-11
export CXX=g++-11
clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
-DLIBCXX_ENABLE_WERROR=NO
check-runtimes
;;
@ -308,7 +294,6 @@ generic-gcc-cxx11)
export CXX=g++-11
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
-DLIBCXX_ENABLE_WERROR=NO
check-runtimes
@ -316,49 +301,42 @@ generic-gcc-cxx11)
generic-asan)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-msan)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-tsan)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-ubsan)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-with_llvm_unwinder)
clean
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-singlethreaded)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-debug)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -366,42 +344,36 @@ generic-no-debug)
generic-no-filesystem)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-random_device)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-localization)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-unicode)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-wide-characters)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
generic-no-experimental)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
check-abi-list
@ -409,7 +381,6 @@ generic-no-experimental)
generic-abi-unstable)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
@ -465,8 +436,7 @@ apple-system-backdeployment-*)
;;
benchmarks)
clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-cxx-benchmarks
;;
documentation)
@ -497,7 +467,6 @@ bootstrapping-build)
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
-DLLVM_ENABLE_ASSERTIONS=ON \
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
-DRUNTIMES_LIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DRUNTIMES_LIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
echo "+++ Running the libc++ and libc++abi tests"
@ -529,7 +498,6 @@ legacy-project-build)
aarch64)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
@ -538,7 +506,6 @@ aarch64-noexceptions)
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
@ -546,14 +513,12 @@ aarch64-noexceptions)
armv8)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
armv8-noexceptions)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
@ -561,14 +526,12 @@ armv8-noexceptions)
armv7)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
armv7-noexceptions)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes
;;
@ -580,15 +543,13 @@ clang-cl-dll)
# correctly when libc++ visibility attributes indicate dllimport linkage
# anyway), thus just disable the experimental library. Remove this
# setting when cmake and the test driver does the right thing automatically.
generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in"
generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
echo "+++ Running the libc++ tests"
${NINJA} -vC "${BUILD_DIR}" check-cxx
;;
clang-cl-static)
clean
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \
-DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in"
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
echo "+++ Running the libc++ tests"
${NINJA} -vC "${BUILD_DIR}" check-cxx
;;
@ -602,7 +563,6 @@ mingw-dll)
generate-cmake \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
-DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
echo "+++ Running the libc++ tests"
${NINJA} -vC "${BUILD_DIR}" check-cxx
@ -612,7 +572,6 @@ mingw-static)
generate-cmake \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
-DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
-DLIBCXX_ENABLE_SHARED=OFF \
-DLIBUNWIND_ENABLE_SHARED=OFF