mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:06:34 +00:00

We always strive to test libc++ as close as possible to the way we are actually shipping it. This was approximated reasonably well by setting up the minimal driver flags when running the test suite, however we were running the test suite against the library located in the build directory. This patch improves the situation by installing the library (the headers, the built library, modules, etc) into a fake location and then running the test suite against that fake "installation root". This should open the door to getting rid of the temporary copy of the headers we make during the build process, however this is left for a future improvement. Note that this adds quite a bit of verbosity whenever running the test suite because we install the headers beforehand every time. We should be able to override this to silence it, however CMake doesn't currently give us a way to do that, see https://gitlab.kitware.com/cmake/cmake/-/issues/26085.
33 lines
1.5 KiB
INI
33 lines
1.5 KiB
INI
@AUTO_GEN_COMMENT@
|
|
|
|
@SERIALIZED_LIT_PARAMS@
|
|
|
|
#
|
|
# This file performs the bridge between the CMake configuration and the Lit
|
|
# configuration files by setting up the LitConfig object and various Lit
|
|
# substitutions from CMake variables.
|
|
#
|
|
# Individual configuration files can take advantage of this bridge by
|
|
# loading the file and then setting up the remaining Lit substitutions.
|
|
#
|
|
|
|
import os, site
|
|
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
|
|
import libcxx.test.format
|
|
|
|
# Basic configuration of the test suite
|
|
config.name = os.path.basename('@LIBCXX_TEST_CONFIG@')
|
|
config.test_source_root = os.path.join('@LIBCXX_SOURCE_DIR@', 'test')
|
|
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
|
|
config.recursiveExpansionLimit = 10
|
|
config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
|
|
|
|
# Add substitutions for bootstrapping the test suite configuration
|
|
config.substitutions.append(('%{libcxx-dir}', '@LIBCXX_SOURCE_DIR@'))
|
|
config.substitutions.append(('%{install-prefix}', '@LIBCXX_TESTING_INSTALL_PREFIX@'))
|
|
config.substitutions.append(('%{include-dir}', '@LIBCXX_TESTING_INSTALL_PREFIX@/@LIBCXX_INSTALL_INCLUDE_DIR@'))
|
|
config.substitutions.append(('%{target-include-dir}', '@LIBCXX_TESTING_INSTALL_PREFIX@/@LIBCXX_INSTALL_INCLUDE_TARGET_DIR@'))
|
|
config.substitutions.append(('%{lib-dir}', '@LIBCXX_TESTING_INSTALL_PREFIX@/@LIBCXX_INSTALL_LIBRARY_DIR@'))
|
|
config.substitutions.append(('%{module-dir}', '@LIBCXX_TESTING_INSTALL_PREFIX@/@LIBCXX_INSTALL_MODULES_DIR@'))
|
|
config.substitutions.append(('%{test-tools-dir}', '@LIBCXX_TEST_TOOLS_PATH@'))
|