]> granicus.if.org Git - strace/blob - tests/strace-V.test
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / strace-V.test
1 #!/bin/sh
2
3 # Check -V option.
4 . "${srcdir=.}/init.sh"
5
6 run_prog_skip_if_failed date +%Y > /dev/null
7 year="$(date +%Y)"
8
9 run_strace -V > "$LOG"
10
11 getval()
12 {
13         sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' \
14                 ../../config.h
15 }
16
17 config_year=$(getval COPYRIGHT_YEAR)
18
19 [ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || {
20         echo >&2 "The year derived from config.h (${config_year}) does not pass sanity checks."
21         exit 1
22 }
23
24 cat > "$EXP" << __EOF__
25 $(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION)
26 Copyright (c) 1991-${config_year} The strace developers <$(getval PACKAGE_URL)>.
27 This is free software; see the source for copying conditions.  There is NO
28 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29 __EOF__
30
31 match_diff "$LOG" "$EXP"