tests: add strace-V.test

* tests/strace-V.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
This commit is contained in:
Fei Jie 2016-05-09 14:19:55 +08:00 committed by Dmitry V. Levin
parent e3086cbc4d
commit c4bb57745a
2 changed files with 16 additions and 0 deletions

View 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 \

15
tests/strace-V.test Executable file
View File

@ -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"