[PATCH 11/12] tests: Add support for providing program arguments

Dmitry V. Levin ldv at altlinux.org
Tue Sep 27 08:32:00 UTC 2016


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160927/3acba2e3/attachment.bin>


More information about the Strace-devel mailing list