On Sun, Dec 24, 2017 at 01:31:49AM +0530, Harsha Sharma wrote:
> On Sat, Dec 23, 2017 at 4:12 AM, Dmitry V. Levin <l...@altlinux.org> wrote:
[...]
> > 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.

So the error diagnostics of tests/run.sh itself is misleading.

> > 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.

OK.

> This patch can be dropped if change doesn't seem to be useful.
> Thanks for your review.

No, there hasn't been a review yet, I was just curious about the purpose
of this patch.  The review follows.

> Subject: [PATCH] tests: enhance error diagostics

s/diagostics/diagnostics/
let's be more specific, e.g.

tests: enhance run.sh usage error diagnostics

> * tests/init.sh: execute timeout command only when run with argument

s/run with argument/invoked with an argument/

> else print error "No command or test file specified"

No need to duplicate the change in the commit message,
in particular, no need to cite the text of error diagnostics.

> Signed-off-by: Harsha Sharma <harshasharmai...@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"

Error diagnostics should be printed to stderr.
If it's an error condition, the program should exit with a non-zero
status.

> +else
> +     exec $TIMEOUT "$@"
> +fi

-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to