qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 06/17] docker: move make check into check_qemu helper


From: Peter Maydell
Subject: Re: [PULL 06/17] docker: move make check into check_qemu helper
Date: Fri, 19 Jun 2020 11:32:46 +0100

On Tue, 24 Jul 2018 at 11:51, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Not all docker images can run the check step. Let's move everything
> into a common helper so we don't need to replicate checks in the
> future.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index ba1f942328..4ff5974016 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -40,6 +40,17 @@ build_qemu()
>      make $MAKEFLAGS
>  }
>
> +check_qemu()
> +{
> +    # default to make check unless the caller specifies
> +    if test -z "$@"; then
> +        INVOCATION="check"
> +    else
> +        INVOCATION="$@"
> +    fi

Philippe pointed out on IRC that a recent change has resulted
in the shell now pointing out an error in the above code
(with "common.rc: line 50: test: check: binary operator expected").

test -z wants a single string argument, so passing it "$@" is wrong
(that will expand to multiple arguments if the function was
called with multiple arguments).

Probably what is wanted is
  if [ $# == 0 ]; then

ie test whether the function was passed no arguments, rather
than looking specifically for whether all its arguments
squashed together end up being the empty string. (If you
really want the latter that's "$*".)

> +    make $MAKEFLAGS $INVOCATION
> +}

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]