]> granicus.if.org Git - strace/commitdiff
tests: move PTRACE_SEIZE check to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Mar 2019 16:02:38 +0000 (16:02 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Mar 2019 16:02:38 +0000 (16:02 +0000)
The check is going to be used by another test soon.

* tests/PTRACE_SEIZE.sh: New file.
* tests/detach-stopped.test: Use it.
* tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh.

tests/Makefile.am
tests/PTRACE_SEIZE.sh [new file with mode: 0755]
tests/detach-stopped.test

index d354695df72e989f151d4865b5a437214b6a863d..5c52c8d6c46833a7f91c321a3d96d3c11e71f4f0 100644 (file)
@@ -365,6 +365,7 @@ VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp
 EXTRA_DIST = \
        COPYING \
        GPL-2.0-or-later \
+       PTRACE_SEIZE.sh \
        accept_compat.h \
        attach-p-cmd.h \
        caps-abbrev.awk \
diff --git a/tests/PTRACE_SEIZE.sh b/tests/PTRACE_SEIZE.sh
new file mode 100755 (executable)
index 0000000..9ffe4c7
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# Skip the test if PTRACE_SEIZE is not supported.
+#
+# Copyright (c) 2014-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+$STRACE -d -enone / > /dev/null 2> "$LOG" ||:
+if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
+       skip_ "PTRACE_SEIZE doesn't work"
+fi
index fb6785342bd75533844ec1b48a5cf9082eb5f2f6..8d92ec7b9b7dc67e3b0ca6111ccbb281cd364bdc 100755 (executable)
@@ -9,15 +9,11 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 . "${srcdir=.}/init.sh"
+. "${srcdir=.}/PTRACE_SEIZE.sh"
 
 run_prog_skip_if_failed \
        kill -0 $$
 
-$STRACE -d -enone / > /dev/null 2> "$LOG"
-if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
-       skip_ "PTRACE_SEIZE doesn't work"
-fi
-
 check_prog sleep
 
 trap - TERM