Skip to contentSkip to conversation

iotests: Print full path of bad output if mismatch

PATCH Applied Fam Zheng 3 participants 4 messages Sep 15, 2017

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 iotests: Print full path of bad output if mismatch

So it is easier to copy paste the path.

---
 tests/qemu-iotests/check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/check +1 -1
index d504b6e455..4583a0c269 100755
@@ -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
Signature · 1 line
2.13.5
Applied
#1 lore raw

Am 15.09.2017 um 07:45 hat Fam Zheng geschrieben:

Quoted 3 lines

So it is easier to copy paste the path.

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

author
#2 lore raw
Quoted 9 lines · Kevin Wolf

Am 15.09.2017 um 07:45 hat Fam Zheng geschrieben:

Quoted 3 lines

So it is easier to copy paste the path.

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

#3 lore raw
In reply to Fam Zheng
Quoted 12 lines · Fam Zheng

So it is easier to copy paste the path.

---
 tests/qemu-iotests/check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/check +0 -0
index d504b6e455..4583a0c269 100755

tests/qemu-iotests/check do · line 356

Quoted 5 lines
tests/qemu-iotests/check +1 -1
@@ -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"

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