libunwind/backport-tests-run-coredump-unwind-Skip-test-if-no-coredump-h.patch
2023-02-21 10:04:00 +08:00

32 lines
1004 B
Diff

From fedff5ac77c945fc0c5df534074163a784bfa5b3 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 7 Sep 2022 14:01:36 +0200
Subject: [PATCH] tests/run-coredump-unwind: Skip test if no coredump has been
created
In some build environments, coredumps are not created even if the
corresponding ulimit is positive. This change skips the test if
the coredump is missing.
---
tests/run-coredump-unwind | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/run-coredump-unwind b/tests/run-coredump-unwind
index 8d07742..0c2b28c 100755
--- a/tests/run-coredump-unwind
+++ b/tests/run-coredump-unwind
@@ -48,6 +48,10 @@ fi
./crasher backing_files
) 2>/dev/null
COREFILE=$TEMPDIR/core*
+if ! test -f "$COREFILE"; then
+ echo "crasher process did not produce coredump, test skipped"
+ exit 77
+fi
# magic option -testcase enables checking for the specific contents of the stack
./test-coredump-unwind $COREFILE -testcase `cat $TEMPDIR/backing_files`
--
2.33.0