[PATCH 11/12] tests: Add support for providing program arguments
Eugene Syromyatnikov
evgsyr at gmail.com
Wed Sep 21 03:12:28 UTC 2016
* tests/init.sh (run_strace_match_diff): Add support for providing
arguments to program via the PROG_ARGS environment variable.
---
tests/init.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/init.sh b/tests/init.sh
index 46a08f9..e37fb20 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -205,10 +205,12 @@ match_grep()
# Usage: run_strace_match_diff [args to run_strace]
run_strace_match_diff()
{
+ local prog_cmdline=
args="$*"
[ -n "$args" -a -z "${args##*-e trace=*}" ] ||
set -- -e trace="$NAME" "$@"
- run_prog > /dev/null
+ [ -n "$PROG_ARGS" ] && prog_cmdline="./$NAME $PROG_ARGS"
+ run_prog $prog_cmdline > /dev/null
run_strace "$@" $args > "$EXP"
match_diff "$LOG" "$EXP"
rm -f "$EXP"
--
1.7.10.4
More information about the Strace-devel
mailing list