summaryrefslogtreecommitdiffstats
path: root/debian/tests/test-@NAME@.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:12:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:12:25 +0000
commitb73a80cfe9b9ba5ce6ce59d895530cbf7c7da389 (patch)
tree6f8b302b168a31b3b4c4ea2a8bc59a7f6735148d /debian/tests/test-@NAME@.in
parentAdding upstream version 21. (diff)
downloadisa-support-b73a80cfe9b9ba5ce6ce59d895530cbf7c7da389.tar.xz
isa-support-b73a80cfe9b9ba5ce6ce59d895530cbf7c7da389.zip
Adding debian version 21.debian/21
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/tests/test-@NAME@.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/tests/test-@NAME@.in b/debian/tests/test-@NAME@.in
new file mode 100644
index 0000000..a359f7d
--- /dev/null
+++ b/debian/tests/test-@NAME@.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+
+"/usr/libexec/$DEB_HOST_MULTIARCH/isa-support/qemu-static-good-@NAME@" "/usr/libexec/$DEB_HOST_MULTIARCH/isa-support/test-@NAME@"
+# trap signal to self
+trap "exit 0" ILL
+trap "exit 0" SEGV
+trap "exit 0" BUS
+
+
+sed_move_to_stderr() {
+ sed -e "/$1/w /dev/stderr" -e "/$1/d"
+}
+
+qemu_bad() {
+ "/usr/libexec/$DEB_HOST_MULTIARCH/isa-support/qemu-static-bad-@NAME@" "/usr/libexec/$DEB_HOST_MULTIARCH/isa-support/test-@NAME@" || true
+}
+
+exec 5>&1
+exec 3>&1
+error_qemu=$( ( ( (qemu_bad) 2>&1 >&3 3>&- ; echo $? >&4) | sed_move_to_stderr 'uncaught target signal' 2>&1 >&3 3>&- ) 4>&1 >&5)
+exec 3>&-
+exec 5>&-
+test "X$error_qemu" = "X0"