qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-iotests: add a "how to" to ./


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-iotests: add a "how to" to ./README
Date: Wed, 26 Jul 2017 12:33:08 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Tue, Jul 25, 2017 at 04:34:19PM +0100, Peter Maydell wrote:
> On 25 July 2017 at 16:20, Stefan Hajnoczi <address@hidden> wrote:
> > On Mon, Jul 24, 2017 at 11:20:44AM +0100, Peter Maydell wrote:
> >> Should ./check be run from the source tree, or the build tree? The
> >> existing README text doesn't say and I don't think your additions
> >> do either.
> >
> > It doesn't matter, both should work.  The script detects both
> > possibilities and rejigs itself to compensate.
> 
> Does that mean
>  if you run it from the source tree in a tree configured
>  for out of tree build it will:
>  (a) pollute your source tree with test output and binaries
>  (b) give you a helpful message about what to do
>  (c) magically find the build tree somehow
>  (d) not need to write any binaries/test output/temp files at all
> 
> ?

I think it would fail since the binaries would be missing in the source
tree.

./check handles either source or out-of-tree mode:

if [ -L "$0" ]
then
    # called from the build tree
    source_iotests=$(dirname "$(readlink "$0")")
    if [ -z "$source_iotests" ]
    then
        _init_error "failed to obtain source tree name from check symlink"
    fi
    source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to enter 
source tree"
    build_iotests=$PWD
else
    # called from the source tree
    source_iotests=$PWD
    # this may be an in-tree build (note that in the following code we may not
    # assume that it truly is and have to test whether the build results
    # actually exist)
    build_iotests=$PWD
fi

build_root="$build_iotests/../.."

Attachment: signature.asc
Description: PGP signature


reply via email to

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