]> granicus.if.org Git - strace/commitdiff
tests/init.sh: add run_prog_match_grep
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 29 Apr 2018 18:46:45 +0000 (20:46 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 May 2018 14:25:27 +0000 (14:25 +0000)
* tests/init.sh (run_prog_match_grep): New function, similar
to run_prog_match_diff.

tests/init.sh

index dffbfcebd88496b97fc1dc4ae3b1cb18d8b7a344..b51ee823c60ec9b912b3c9b9cd0cb79b8f54019b 100644 (file)
@@ -230,6 +230,17 @@ run_strace_match_diff()
        match_diff "$LOG" "$EXP"
 }
 
+# Usage: run_strace_match_grep [args to run_strace]
+run_strace_match_grep()
+{
+       args="$*"
+       [ -n "$args" -a -z "${args##*-e trace=*}" ] ||
+               set -- -e trace="$NAME" "$@"
+       run_prog > /dev/null
+       run_strace "$@" $args > "$EXP"
+       match_grep "$LOG" "$EXP"
+}
+
 # Print kernel version code.
 # usage: kernel_version_code $(uname -r)
 kernel_version_code()