[PATCH] tests: enhance error diagostics

Harsha Sharma harshasharmaiitr at gmail.com
Sat Dec 23 20:01:49 UTC 2017


On Sat, Dec 23, 2017 at 4:12 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
>
> On Sat, Dec 23, 2017 at 02:34:31AM +0530, Harsha Sharma wrote:
> > * tests/init.sh: execute timeout command only when run with argument
> > else print error "No command or test file specified"
> >
> > Signed-off-by: Harsha Sharma <harshasharmaiitr at gmail.com>
> > ---
> >  tests/run.sh | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/run.sh b/tests/run.sh
> > index d1b796ca..6ff69b4d 100755
> > --- a/tests/run.sh
> > +++ b/tests/run.sh
> > @@ -9,4 +9,8 @@ TIMEOUT="timeout -k 5 -s XCPU $TIMEOUT_DURATION"
> >  $TIMEOUT true > /dev/null 2>&1 ||
> >       TIMEOUT=
> >
> > -exec $TIMEOUT "$@"
> > +if [ $# -eq 0 ]; then
> > +     echo "No command or test file specified"
> > +else
> > +     exec $TIMEOUT "$@"
> > +fi
>
> Why do you think this change is useful?
>
Executing this script without any argument gives 'Try 'timeout --help'
for more information.' which should not be the case.

> tests/run.sh is a part of test infrastructure,
> is it natural to invoke this script without arguments?
>
No, but can help someone using it for first time.
This patch can be dropped if change doesn't seem to be useful.
Thanks for your review.

Regards,
Harsha Sharma

>
> --
> ldv
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>




More information about the Strace-devel mailing list