qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch
@ 2017-09-15  5:45 Fam Zheng
  2017-09-15 12:16 ` Kevin Wolf
  2017-09-15 18:13 ` Eric Blake
  0 siblings, 2 replies; 4+ messages in thread
From: Fam Zheng @ 2017-09-15  5:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Max Reitz, qemu-block

So it is easier to copy paste the path.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index d504b6e455..4583a0c269 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -353,7 +353,7 @@ do
                 else
                     echo " - output mismatch (see $seq.out.bad)"
                     mv $tmp.out $seq.out.bad
-                    $diff -w "$reference" $seq.out.bad
+                    $diff -w "$reference" $(realpath $seq.out.bad)
                     err=true
                 fi
             fi
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch
  2017-09-15  5:45 [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch Fam Zheng
@ 2017-09-15 12:16 ` Kevin Wolf
  2017-09-15 12:30   ` Fam Zheng
  2017-09-15 18:13 ` Eric Blake
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2017-09-15 12:16 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, Max Reitz, qemu-block

Am 15.09.2017 um 07:45 hat Fam Zheng geschrieben:
> So it is easier to copy paste the path.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>

I don't think I ever tried to do anything with the diff that would have
required the full path, but if you say so... :-)

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch
  2017-09-15 12:16 ` Kevin Wolf
@ 2017-09-15 12:30   ` Fam Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2017-09-15 12:30 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Max Reitz, qemu-block

On Fri, 09/15 14:16, Kevin Wolf wrote:
> Am 15.09.2017 um 07:45 hat Fam Zheng geschrieben:
> > So it is easier to copy paste the path.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> I don't think I ever tried to do anything with the diff that would have
> required the full path, but if you say so... :-)
> 
> Thanks, applied to the block branch.

Thanks.

I often create a new reference output or fix an old one by

    cp /x/y/z.out.bad tests/qemu-iotests/???.out

and either the /x/y/z or the path to QEMU repo is some typing if from
out-of-tree build, so getting it from the output of check is handy..

Fam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch
  2017-09-15  5:45 [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch Fam Zheng
  2017-09-15 12:16 ` Kevin Wolf
@ 2017-09-15 18:13 ` Eric Blake
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2017-09-15 18:13 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Kevin Wolf, qemu-block, Max Reitz

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

On 09/15/2017 12:45 AM, Fam Zheng wrote:
> So it is easier to copy paste the path.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index d504b6e455..4583a0c269 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -353,7 +353,7 @@ do
>                  else
>                      echo " - output mismatch (see $seq.out.bad)"
>                      mv $tmp.out $seq.out.bad
> -                    $diff -w "$reference" $seq.out.bad
> +                    $diff -w "$reference" $(realpath $seq.out.bad)

Realpath collapses symlinks, and $() costs a process.  Also, your patch
fails miserably if the current working directory contains spaces; you
forgot to quote $().  It would be simpler, and more correct, to do:

$diff -w "$reference" "$PWD/$seq.out.bad"

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-15 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-15  5:45 [Qemu-devel] [PATCH] iotests: Print full path of bad output if mismatch Fam Zheng
2017-09-15 12:16 ` Kevin Wolf
2017-09-15 12:30   ` Fam Zheng
2017-09-15 18:13 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).