[prev in list] [next in list] [prev in thread] [next in thread]
List: strace
Subject: Re: [PATCH 11/12] tests: Add support for providing program arguments
From: "Dmitry V. Levin" <ldv () altlinux ! org>
Date: 2016-09-27 8:32:00
Message-ID: 20160927083200.GB5916 () altlinux ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Wed, Sep 21, 2016 at 06:12:28AM +0300, Eugene Syromyatnikov wrote:
> * 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"
I don't think we really need it. I prefer the approach taken by
tests/execve-v.c and similar tests/*-v.c tests.
--
ldv
[Attachment #5 (application/pgp-signature)]
------------------------------------------------------------------------------
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic