2021-10-13 00:46:21 +08:00
|
|
|
@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}',
|
2021-11-23 03:51:09 +08:00
|
|
|
'-L {0} -Wl,-rpath,{0} -lunwind -ldl {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
|
2021-10-13 00:46:21 +08:00
|
|
|
))
|
2021-10-28 03:04:18 +08:00
|
|
|
config.substitutions.append(('%{exec}', ''))
|
2021-10-13 00:46:21 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|