cxx/test/lit.site.cfg.in

32 lines
1.7 KiB
INI
Raw Normal View History

@AUTO_GEN_COMMENT@
config.cxx_under_test = "@LIBCXX_COMPILER@"
config.std = "@LIBCXX_STD_VERSION@"
config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.cxx_library_root = "@LIBCXX_LIBRARY_DIR@"
config.enable_exceptions = "@LIBCXX_ENABLE_EXCEPTIONS@"
config.enable_rtti = "@LIBCXX_ENABLE_RTTI@"
config.enable_shared = "@LIBCXX_ENABLE_SHARED@"
config.enable_32bit = "@LIBCXX_BUILD_32_BITS@"
Add option to disable access to the global filesystem namespace. Systems like FreeBSD's Capsicum and Nuxi CloudABI apply the concept of capability-based security on the way processes can interact with the filesystem API. It is no longer possible to interact with the VFS through calls like open(), unlink(), rename(), etc. Instead, processes are only allowed to interact with files and directories to which they have been granted access. The *at() functions can be used for this purpose. This change adds a new config switch called _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE. If set, all functionality that requires the global filesystem namespace will be disabled. More concretely: - fstream's open() function will be removed. - cstdio will no longer pull in fopen(), rename(), etc. - The test suite's get_temp_file_name() will be removed. This will cause all tests that use the global filesystem namespace to break, but will at least make all the other tests run (as get_temp_file_name will not build anyway). It is important to mention that this change will make fstream rather useless on those systems for now. Still, I'd rather not have fstream disabled entirely, as it is of course possible to come up with an extension for fstream that would allow access to local filesystem namespaces (e.g., by adding an openat() member function). Differential revision: http://reviews.llvm.org/D8194 Reviewed by: jroelofs (thanks!) git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 16:44:39 +01:00
config.enable_global_filesystem_namespace = "@LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE@"
Make the presence of stdin and stdout optional. The idea behind Nuxi CloudABI is that it is targeted at (but not limited to) running networked services in a sandboxed environment. The model behind stdin, stdout and stderr is strongly focused on interactive tools in a command shell. CloudABI does not support the notion of stdin and stdout, as 'standard input/output' does not apply to services. The concept of stderr does makes sense though, as services do need some mechanism to log error messages in a uniform way. This patch extends libc++ in such a way that std::cin and std::cout and the associated <cstdio>/<cwchar> functions can be disabled through the flags _LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time it attempts to clean up src/iostream.cpp a bit. Instead of using a single array of mbstate_t objects and hardcoding the array indices, it creates separate objects that declared next to the iostream objects and their buffers. The code is also restructured by interleaving the construction and setup of c* and wc* objects. That way it is more obvious that this is done identically. The c* and wc* objects already have separate unit tests. Make use of this fact by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in both directions. If stdin or stdout is disabled, these tests will therefore test for the absence of c* and wc*. Differential Revision: http://reviews.llvm.org/D8340 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 15:35:46 +01:00
config.enable_stdin = "@LIBCXX_ENABLE_STDIN@"
config.enable_stdout = "@LIBCXX_ENABLE_STDOUT@"
config.enable_threads = "@LIBCXX_ENABLE_THREADS@"
config.enable_thread_unsafe_c_functions = "@LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS@"
config.enable_monotonic_clock = "@LIBCXX_ENABLE_MONOTONIC_CLOCK@"
config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@"
config.use_sanitizer = "@LLVM_USE_SANITIZER@"
config.sanitizer_library = "@LIBCXX_SANITIZER_LIBRARY@"
config.abi_library_path = "@LIBCXX_CXX_ABI_LIBRARY_PATH@"
config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
config.target_triple = "@LIBCXX_TARGET_TRIPLE@"
config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@"
config.target_info = "@LIBCXX_TARGET_INFO@"
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 01:42:17 +01:00
config.executor = "@LIBCXX_EXECUTOR@"
config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@"
# Let the main config do the real work.
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")