[runtimes] Remove all traces of the legacy testing configuration system

Now that all jobs have moved over to the new style of Lit configuration,
we can remove all traces of the legacy testing configuration system.
This includes:
- Cache settings that are not honored or useful anymore
- Several CMake options that were only useful in the context of the
  legacy Lit configuration system
- A bunch of Python support code that is not used anymore
- The legacy lit.cfg.in files themselves

Differential Revision: https://reviews.llvm.org/D134650

NOKEYCHECK=True
GitOrigin-RevId: a48f018bb7d8fadc67c08e71409c31713daa0071
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0a4541b..5da584a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,47 +7,7 @@
   endif()
 endmacro()
 
-if (NOT DEFINED LIBCXX_ENABLE_SHARED)
-  set(LIBCXX_ENABLE_SHARED ON)
-endif()
-
-option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI
-       "Whether the libc++abi tests should link with the shared libc++abi library"
-       ${LIBCXXABI_ENABLE_SHARED})
-
-option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX
-       "Whether the libc++abi tests should link with the shared libc++ library"
-       ${LIBCXX_ENABLE_SHARED})
-
-if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_SHARED)
-  message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being ON requires LIBCXXABI_ENABLE_SHARED to be ON")
-endif()
-
-if(NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_STATIC)
-  message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being OFF requires LIBCXXABI_ENABLE_STATIC to be ON")
-endif()
-
-if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX AND NOT LIBCXX_ENABLE_SHARED)
-  message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being ON requires LIBCXX_ENABLE_SHARED to be ON")
-endif()
-
-if(DEFINED LIBCXX_ENABLE_STATIC
-   AND NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX
-   AND NOT LIBCXX_ENABLE_STATIC)
-  message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being OFF requires LIBCXX_ENABLE_STATIC to be ON")
-endif()
-
-pythonize_bool(LIBCXX_ENABLE_SHARED)
-pythonize_bool(LIBCXXABI_ENABLE_SHARED)
-pythonize_bool(LIBCXXABI_ENABLE_THREADS)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
-pythonize_bool(LIBCXXABI_USE_COMPILER_RT)
-pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
-pythonize_bool(LIBCXX_ENABLE_PARALLEL_ALGORITHMS)
-pythonize_bool(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX)
-pythonize_bool(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI)
-set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
-    "TargetInfo to use when setting up test environment.")
 set(LIBCXXABI_EXECUTOR "${Python3_EXECUTABLE} ${LIBCXXABI_LIBCXX_PATH}/utils/run.py" CACHE STRING
     "Executor to use when running tests.")
 
diff --git a/test/libcxxabi/__init__.py b/test/libcxxabi/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/test/libcxxabi/__init__.py
+++ /dev/null
diff --git a/test/libcxxabi/test/__init__.py b/test/libcxxabi/test/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/test/libcxxabi/test/__init__.py
+++ /dev/null
diff --git a/test/libcxxabi/test/config.py b/test/libcxxabi/test/config.py
deleted file mode 100644
index 4adc566..0000000
--- a/test/libcxxabi/test/config.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#===----------------------------------------------------------------------===##
-#
-# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-#
-#===----------------------------------------------------------------------===##
-import os
-import sys
-
-from libcxx.test.config import Configuration as LibcxxConfiguration
-from libcxx.test.config import intMacroValue
-
-
-class Configuration(LibcxxConfiguration):
-    # pylint: disable=redefined-outer-name
-    def __init__(self, lit_config, config):
-        super(Configuration, self).__init__(lit_config, config)
-        self.libcxxabi_hdr_root = None
-        self.libcxxabi_src_root = None
-        self.libcxxabi_obj_root = None
-        self.abi_library_root = None
-        self.libcxx_src_root = None
-
-    def configure_src_root(self):
-        self.libcxxabi_hdr_root = self.get_lit_conf(
-            'libcxxabi_hdr_root',
-            self.project_obj_root)
-        self.libcxxabi_src_root = self.get_lit_conf(
-            'libcxxabi_src_root',
-            os.path.dirname(self.config.test_source_root))
-        self.libcxx_src_root = self.get_lit_conf(
-            'libcxx_src_root',
-            os.path.join(self.libcxxabi_src_root, '/../libcxx'))
-
-    def configure_obj_root(self):
-        self.libcxxabi_obj_root = self.get_lit_conf('libcxxabi_obj_root')
-        super(Configuration, self).configure_obj_root()
-
-    def configure_features(self):
-        super(Configuration, self).configure_features()
-        if not self.get_lit_bool('llvm_unwinder', False):
-            self.config.available_features.add('libcxxabi-has-system-unwinder')
-
-    def configure_compile_flags(self):
-        self.cxx.compile_flags += [
-            '-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS',
-        ]
-        if self.get_lit_bool('enable_exceptions', True):
-            self.cxx.compile_flags += ['-funwind-tables']
-        if not self.get_lit_bool('enable_threads', True):
-            self.cxx.compile_flags += ['-D_LIBCXXABI_HAS_NO_THREADS']
-            self.config.available_features.add('no-threads')
-        super(Configuration, self).configure_compile_flags()
-
-    def configure_compile_flags_header_includes(self):
-        cxx_headers = self.get_lit_conf('cxx_headers', None) or \
-            os.path.join(self.libcxxabi_hdr_root, 'include', 'c++', 'v1')
-        if cxx_headers == '':
-            self.lit_config.note('using the systems c++ headers')
-        else:
-            self.cxx.compile_flags += ['-nostdinc++']
-        if not os.path.isdir(cxx_headers):
-            self.lit_config.fatal("cxx_headers='%s' is not a directory."
-                                  % cxx_headers)
-        (path, version) = os.path.split(cxx_headers)
-        (path, cxx) = os.path.split(path)
-        triple = self.get_lit_conf('target_triple', None)
-        if triple is not None:
-            cxx_target_headers = os.path.join(path, triple, cxx, version)
-            if os.path.isdir(cxx_target_headers):
-                self.cxx.compile_flags += ['-I' + cxx_target_headers]
-        self.cxx.compile_flags += ['-I' + cxx_headers]
-        self.cxx.compile_flags += ['-I' + os.path.join(self.libcxx_src_root, 'src')]
-
-        libcxxabi_headers = self.get_lit_conf(
-            'libcxxabi_headers',
-            os.path.join(self.libcxxabi_src_root, 'include'))
-        if not os.path.isdir(libcxxabi_headers):
-            self.lit_config.fatal("libcxxabi_headers='%s' is not a directory."
-                                  % libcxxabi_headers)
-        self.cxx.compile_flags += ['-I' + libcxxabi_headers]
-
-        libunwind_headers = self.get_lit_conf('libunwind_headers', None)
-        if self.get_lit_bool('llvm_unwinder', False) and libunwind_headers:
-            if not os.path.isdir(libunwind_headers):
-                self.lit_config.fatal("libunwind_headers='%s' is not a directory."
-                                      % libunwind_headers)
-            self.cxx.compile_flags += ['-I' + libunwind_headers]
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
deleted file mode 100644
index 7a786a3..0000000
--- a/test/lit.site.cfg.in
+++ /dev/null
@@ -1,65 +0,0 @@
-@AUTO_GEN_COMMENT@
-
-@SERIALIZED_LIT_PARAMS@
-
-import os
-import site
-
-config.cxx_under_test           = "@CMAKE_CXX_COMPILER@"
-config.project_obj_root         = "@CMAKE_BINARY_DIR@"
-config.install_root             = "@CMAKE_BINARY_DIR@"
-config.libcxxabi_hdr_root       = "@LIBCXXABI_HEADER_DIR@"
-config.libcxxabi_src_root       = "@LIBCXXABI_SOURCE_DIR@"
-config.libcxxabi_obj_root       = "@LIBCXXABI_BINARY_DIR@"
-config.abi_library_root         = "@LIBCXXABI_LIBRARY_DIR@"
-config.libcxx_src_root          = "@LIBCXXABI_LIBCXX_PATH@"
-config.cxx_headers              = "@LIBCXXABI_LIBCXX_INCLUDES@"
-config.libunwind_headers        = "@LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL@"
-config.cxx_library_root         = "@LIBCXXABI_LIBCXX_LIBRARY_PATH@"
-config.llvm_unwinder            = @LIBCXXABI_USE_LLVM_UNWINDER@
-config.builtins_library         = "@LIBCXXABI_BUILTINS_LIBRARY@"
-config.enable_threads           = @LIBCXXABI_ENABLE_THREADS@
-config.target_info              = "@LIBCXXABI_TARGET_INFO@"
-config.executor                 = "@LIBCXXABI_EXECUTOR@"
-config.libcxxabi_shared         = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI@
-config.enable_shared            = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX@
-config.host_triple              = "@LLVM_HOST_TRIPLE@"
-config.sysroot                  = "@CMAKE_SYSROOT@"
-config.gcc_toolchain            = "@CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN@"
-config.cxx_ext_threads          = @LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@
-
-config.pstl_src_root            = "@ParallelSTL_SOURCE_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
-config.pstl_obj_root            = "@ParallelSTL_BINARY_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
-
-# Code signing
-config.llvm_codesign_identity   = "@LLVM_CODESIGNING_IDENTITY@"
-
-site.addsitedir(os.path.join(config.libcxxabi_src_root, 'test'))
-site.addsitedir(os.path.join(config.libcxx_src_root, 'utils'))
-
-# name: The name of this test suite.
-config.name = 'libc++abi'
-
-# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.cpp', '.s']
-
-# test_source_root: The root path where tests are located.
-config.test_source_root = os.path.join(config.libcxxabi_src_root, 'test')
-
-# Allow expanding substitutions that are based on other substitutions
-config.recursiveExpansionLimit = 10
-
-# Infer the test_exec_root from the build directory.
-config.test_exec_root = os.path.join(config.libcxxabi_obj_root, 'test')
-
-import libcxx.test.format
-config.test_format = libcxx.test.format.CxxStandardLibraryTest()
-
-lit_config.note('Using configuration variant: libcxxabi')
-import libcxxabi.test.config
-configuration = libcxxabi.test.config.Configuration(lit_config, config)
-configuration.configure()
-configuration.print_config_info()
-
-lit_config.warning("This is a legacy testing configuration which will be removed in LLVM 16. "
-                   "Please use one of the configurations in libcxxabi/test/configs or define your own.")