From: Fei Jie Date: Mon, 9 May 2016 06:19:55 +0000 (+0800) Subject: tests: add strace-V.test X-Git-Tag: v4.12~205 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4bb57745aafa5ef57a5af7a35a2764239ec010b;p=strace tests: add strace-V.test * tests/strace-V.test: New test. * tests/Makefile.am (MISC_TESTS): Add it. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index a7b09592..7eae886f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..c474f885 --- /dev/null +++ b/tests/strace-V.test @@ -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"