llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in

63 lines
2.1 KiB
INI

@AUTO_GEN_COMMENT@
@SERIALIZED_LIT_PARAMS@
#
# Configuration file for running the libunwind tests against the shared library.
#
# This file is a lot simpler than the ones for libc++ and libc++abi because
# while libunwind is written in C++, it doesn't use the C++ Standard Library
# so we don't need to set that up to run the tests correctly.
#
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.format
# Basic configuration of the test suite
config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = '@CMAKE_BINARY_DIR@'
compile_flags = []
link_flags = []
if @LIBUNWIND_USES_ARM_EHABI@:
config.available_features.add('libunwind-arm-ehabi')
if not @LIBUNWIND_ENABLE_THREADS@:
compile_flags.append('-D_LIBUNWIND_HAS_NO_THREADS')
config.available_features.add('libunwind-no-threads')
if @LIBUNWIND_ENABLE_CET@:
compile_flags.append('-fcf-protection=full')
if '@CMAKE_SYSTEM_NAME@' == 'Linux':
link_flags.append('-Wl,--export-dynamic')
# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')
config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
'-L {0} -Wl,-rpath,{0} -lunwind -ldl {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
))
config.substitutions.append(('%{exec}', ''))
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
libcxx.test.newconfig.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)