2010-12-11 03:47:54 +08:00
|
|
|
@AUTO_GEN_COMMENT@
|
2020-06-13 03:19:55 +08:00
|
|
|
|
|
|
|
import os
|
|
|
|
import site
|
|
|
|
|
2014-12-07 05:02:58 +08:00
|
|
|
config.cxx_under_test = "@LIBCXX_COMPILER@"
|
2015-10-15 02:22:15 +08:00
|
|
|
config.project_obj_root = "@CMAKE_BINARY_DIR@"
|
2014-12-07 05:02:58 +08:00
|
|
|
config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
|
|
|
|
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
|
2015-01-15 07:38:12 +08:00
|
|
|
config.cxx_library_root = "@LIBCXX_LIBRARY_DIR@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_exceptions = @LIBCXX_ENABLE_EXCEPTIONS@
|
|
|
|
config.enable_experimental = @LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY@
|
2019-03-21 08:04:31 +08:00
|
|
|
config.enable_filesystem = @LIBCXX_ENABLE_FILESYSTEM@
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_rtti = @LIBCXX_ENABLE_RTTI@
|
[libcxx] Allow tests to link with static libc++abi/libc++ even if the shared version is present
Summary:
This is essentially D71894, but for libc++.
This is needed for running libc++ tests over SSH.
Reviewers: EricWF, ldionne, phosek, mehdi_amini, mclow.lists, jroelofs, bcraig, #libc
Reviewed By: ldionne, phosek, #libc
Subscribers: mgorny, christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D72687
2020-03-25 20:27:05 +08:00
|
|
|
config.enable_shared = @LIBCXX_LINK_TESTS_WITH_SHARED_LIBCXX@
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_32bit = @LIBCXX_BUILD_32_BITS@
|
2014-12-07 05:02:58 +08:00
|
|
|
config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@"
|
2014-12-23 04:49:45 +08:00
|
|
|
config.use_sanitizer = "@LLVM_USE_SANITIZER@"
|
2015-07-22 08:33:36 +08:00
|
|
|
config.sanitizer_library = "@LIBCXX_SANITIZER_LIBRARY@"
|
2014-12-07 05:02:58 +08:00
|
|
|
config.abi_library_path = "@LIBCXX_CXX_ABI_LIBRARY_PATH@"
|
2015-01-16 02:35:04 +08:00
|
|
|
config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
|
2016-11-14 06:27:00 +08:00
|
|
|
config.host_triple = "@LLVM_HOST_TRIPLE@"
|
|
|
|
config.target_triple = "@TARGET_TRIPLE@"
|
[CMake] Support CMake variables for setting target, sysroot and toolchain
CMake has a standard way of setting target triple, sysroot and external
toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and
CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into
corresponding --target=, --sysroot= and --gcc-toolchain= variables add
included appended to CMAKE_<LANG>_FLAGS.
libunwind, libc++abi, libc++ provides their own mechanism through
<PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN
variables. These are also passed to lit via lit.site.cfg, and lit config
uses these to set the corresponding compiler flags when building tessts.
This means that there are two different ways of setting target, sysroot
and toolchain, but only one is properly supported in lit. This change
extends CMake build for libunwind, libc++abi and libc++ to also support
the CMake variables in addition to project specific ones in lit.
Differential Revision: https://reviews.llvm.org/D57670
llvm-svn: 353084
2019-02-05 04:02:26 +08:00
|
|
|
config.use_target = bool("@LIBCXX_TARGET_TRIPLE@")
|
2015-01-16 08:55:15 +08:00
|
|
|
config.sysroot = "@LIBCXX_SYSROOT@"
|
|
|
|
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.generate_coverage = @LIBCXX_GENERATE_COVERAGE@
|
2015-02-13 23:25:21 +08:00
|
|
|
config.target_info = "@LIBCXX_TARGET_INFO@"
|
2018-02-23 23:19:48 +08:00
|
|
|
config.test_linker_flags = "@LIBCXX_TEST_LINKER_FLAGS@"
|
|
|
|
config.test_compiler_flags = "@LIBCXX_TEST_COMPILER_FLAGS@"
|
|
|
|
|
Add remote testing support to the lit config.
Executors can be specified at configure time by using the -DLIBCXX_EXECUTOR=""
option. Examples include:
$ cmake <other_flags> -DLIBCXX_EXECUTOR="TimeoutExecutor(30,LocalExecutor())"
This runs individual tests with a maximum duration
$ cmake <other_flags> -DLIBCXX_EXECUTOR="SSHExecutor('hostname','username')"
This runs tests on a remote target, using scp to shuttle binaries to the
target, and ssh to invoke commands there.
$ cmake <other_flags> -DLIBCXX_EXECUTOR="PrefixExecutor('/path/to/run/script',LocalExecutor())"
This assumes the script knows how to copy run the executables passed to it,
and allows for the ultimate control. This is useful for running things
inside emulators like Valgrind & QEMU.
TODO: This doesn't claim to support ShTest tests yet, that will take a bit more
thought & finagling (I'm still not sure how to orchestrate copy-in for those cases.
I've also punted on what to do about tests that read data files. The testsuite
has several tests that need to read *.dat files placed next to them, and
currently those aren't copied over when using, say, an SSHExecutor. The
affected tests are:
libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
libc++ :: std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
Note: One thing to watch out for when using the SSHExecutor for cross-testing is
that you'll also want to specify a TargetInfo object (so that the host's
features aren't used for available-features checks and flags setup).
http://reviews.llvm.org/D7380
llvm-svn: 230592
2015-02-26 08:42:17 +08:00
|
|
|
config.executor = "@LIBCXX_EXECUTOR@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.llvm_unwinder = @LIBCXXABI_USE_LLVM_UNWINDER@
|
2019-02-06 03:50:47 +08:00
|
|
|
config.builtins_library = "@LIBCXX_BUILTINS_LIBRARY@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.has_libatomic = @LIBCXX_HAS_ATOMIC_LIB@
|
|
|
|
config.debug_build = @LIBCXX_DEBUG_BUILD@
|
[libcxx] Allow tests to link with static libc++abi/libc++ even if the shared version is present
Summary:
This is essentially D71894, but for libc++.
This is needed for running libc++ tests over SSH.
Reviewers: EricWF, ldionne, phosek, mehdi_amini, mclow.lists, jroelofs, bcraig, #libc
Reviewed By: ldionne, phosek, #libc
Subscribers: mgorny, christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D72687
2020-03-25 20:27:05 +08:00
|
|
|
config.libcxxabi_shared = @LIBCXX_LINK_TESTS_WITH_SHARED_LIBCXXABI@
|
2019-02-05 12:44:03 +08:00
|
|
|
config.cxx_ext_threads = @LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY@
|
2019-08-08 20:43:04 +08:00
|
|
|
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
|
2019-09-06 04:44:08 +08:00
|
|
|
config.libcxx_gdb = "@LIBCXX_GDB@"
|
2010-12-11 03:47:54 +08:00
|
|
|
|
2019-09-06 05:24:23 +08:00
|
|
|
# Code signing
|
|
|
|
config.llvm_codesign_identity = "@LLVM_CODESIGNING_IDENTITY@"
|
|
|
|
|
2020-06-13 03:19:55 +08:00
|
|
|
site.addsitedir(os.path.join(config.libcxx_src_root, 'utils'))
|
|
|
|
|
|
|
|
# name: The name of this test suite.
|
|
|
|
config.name = 'libc++'
|
|
|
|
|
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
|
|
|
config.suffixes = ['.pass.cpp', '.fail.cpp', '.sh.cpp', '.pass.mm']
|
|
|
|
|
|
|
|
# test_source_root: The root path where tests are located.
|
|
|
|
config.test_source_root = os.path.join(config.libcxx_src_root, 'test')
|
|
|
|
|
|
|
|
# Allow expanding substitutions that are based on other substitutions
|
|
|
|
config.recursiveExpansionLimit = 10
|
|
|
|
|
|
|
|
# Infer the test_exec_root from the libcxx_object root.
|
|
|
|
config.test_exec_root = os.path.join(config.libcxx_obj_root, 'test')
|
|
|
|
|
2020-06-30 22:10:30 +08:00
|
|
|
import libcxx.test.format
|
|
|
|
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
|
2020-06-26 12:55:29 +08:00
|
|
|
|
2020-06-13 03:19:55 +08:00
|
|
|
lit_config.note('Using configuration variant: {}'.format(config.configuration_variant))
|
|
|
|
import libcxx.test.config
|
|
|
|
configuration = libcxx.test.config.Configuration(lit_config, config)
|
|
|
|
configuration.configure()
|
|
|
|
configuration.print_config_info()
|