summaryrefslogtreecommitdiff
path: root/libunwind/test
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2022-05-26 10:19:25 -0400
committerLouis Dionne <ldionne.2@gmail.com>2022-05-26 15:29:39 -0400
commit92bbcfaa97408991813fda5c56e864c629f67a01 (patch)
tree8295e5762fb3d39bfd7830149f55d0890aae2570 /libunwind/test
parent75acec818e3a419836cf4827eb64faee719becb8 (diff)
downloadllvm-92bbcfaa97408991813fda5c56e864c629f67a01.tar.gz
[libunwind] Tidy-up the testing configuration for libunwind
Start testing Apple backdeployment with older libunwinds, and stop explicitly specifying the libunwind testing config, since it is already selected correctly by default. Differential Revision: https://reviews.llvm.org/D126470
Diffstat (limited to 'libunwind/test')
-rw-r--r--libunwind/test/configs/apple-libunwind-backdeployment.cfg.in64
-rw-r--r--libunwind/test/libunwind_01.pass.cpp4
-rw-r--r--libunwind/test/signal_frame.pass.cpp4
3 files changed, 68 insertions, 4 deletions
diff --git a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
new file mode 100644
index 000000000000..d4777e2f6917
--- /dev/null
+++ b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
@@ -0,0 +1,64 @@
+# Testing configuration for back-deployment against older Apple system libunwind.
+#
+# Under this configuration, we compile and link all the test suite against the latest libunwind,
+# however we run against the libunwind on a different platform. This emulates the workflow of
+# a developer building their application using recent tools but with the goal of deploying
+# on existing devices running an older OS (and hence an older dylib).
+
+import os, site
+site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.newconfig, libcxx.test.dsl
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+BACKDEPLOYMENT_PARAMETERS = [
+ libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
+ actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
+ help="""
+ The simulated root of the system (for libc++) when running tests.
+
+ This should be a directory hierarchy under which the libc++ dylib can be found.
+ The dylib in that hierarchy is the one that will be used at runtime when running
+ the tests.
+ """),
+ libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
+ actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
+ help="""
+ The simulated root of the system (for libc++abi) when running tests.
+
+ This should be a directory hierarchy under which the libc++abi dylib can be found.
+ The dylib in that hierarchy is the one that will be used at runtime when running
+ the tests.
+ """),
+ libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
+ actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
+ help="""
+ The simulated root of the system (for libunwind) when running tests.
+
+ This should be a directory hierarchy under which the libunwind dylib can be found.
+ The dylib in that hierarchy is the one that will be used at runtime when running
+ the tests.
+ """),
+]
+
+config.substitutions.append(('%{flags}',
+ '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -I %{include}'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind'
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
+))
+
+import os, site
+import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
+libcxx.test.newconfig.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
diff --git a/libunwind/test/libunwind_01.pass.cpp b/libunwind/test/libunwind_01.pass.cpp
index 8b4825ac30dc..bbfaffd153cc 100644
--- a/libunwind/test/libunwind_01.pass.cpp
+++ b/libunwind/test/libunwind_01.pass.cpp
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-// TODO: Investigate these failures on x86_64 macOS back deployment
-// UNSUPPORTED: target=x86_64-apple-darwin{{.+}}
+// TODO: Investigate this failure on x86_64 macOS back deployment
+// XFAIL: use_system_cxx_lib && target=x86_64-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
diff --git a/libunwind/test/signal_frame.pass.cpp b/libunwind/test/signal_frame.pass.cpp
index d9fb439cd1e7..b17804efa08c 100644
--- a/libunwind/test/signal_frame.pass.cpp
+++ b/libunwind/test/signal_frame.pass.cpp
@@ -9,8 +9,8 @@
// Ensure that functions marked as signal frames are reported as such.
-// TODO: Investigate this failure on macOS
-// XFAIL: target={{.+}}-apple-darwin{{.+}}
+// TODO: Investigate this failure on Apple
+// XFAIL: target={{.+}}-apple-{{.+}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan