]> granicus.if.org Git - strace/commitdiff
tests: add strace-V.test
authorFei Jie <feij.fnst@cn.fujitsu.com>
Mon, 9 May 2016 06:19:55 +0000 (14:19 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 23:18:40 +0000 (23:18 +0000)
* tests/strace-V.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.

tests/Makefile.am
tests/strace-V.test [new file with mode: 0755]

index a7b09592394847a62de3d50a5b5e2d556846568e..7eae886f85fa63a850e627442e768c55b44b274f 100644 (file)
@@ -606,6 +606,7 @@ MISC_TESTS = \
        redirect.test \
        restart_syscall.test \
        strace-T.test \
+       strace-V.test \
        strace-f.test \
        strace-r.test \
        strace-t.test \
diff --git a/tests/strace-V.test b/tests/strace-V.test
new file mode 100755 (executable)
index 0000000..c474f88
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Check -V option.
+
+. "${srcdir=.}/init.sh"
+
+run_strace -V > "$LOG"
+
+PACKAGE_NAME="$(sed -n 's/#define[[:space:]]*PACKAGE_NAME[[:space:]]*"\([^"]*\)".*/\1/p' ../config.h)"
+VERSION="$(sed -n 's/#define[[:space:]]*VERSION[[:space:]]*"\([^"]*\)".*/\1/p' ../config.h)"
+
+printf "%s -- version %s\n" "$PACKAGE_NAME" "$VERSION" > "$OUT"
+
+match_diff "$LOG" "$OUT"
+rm -f "$OUT"