]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode
authorThomas Huth <thuth@redhat.com>
Wed, 9 Feb 2022 10:15:29 +0000 (11:15 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 16 Feb 2022 14:01:33 +0000 (15:01 +0100)
When running in TAP mode, stdout is reserved for the TAP protocol.
To see the "diff" of the failed test, we have to print it to
stderr instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220209101530.3442837-8-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/qemu-iotests/testrunner.py

index 0eace147b8fcb37fa605c65108868e2932d26043..9a942739754f72cdd846871df8ebddcd6d6aba88 100644 (file)
@@ -404,7 +404,10 @@ class TestRunner(ContextManager['TestRunner']):
             if res.status == 'fail':
                 failed.append(name)
                 if res.diff:
-                    print('\n'.join(res.diff))
+                    if self.tap:
+                        print('\n'.join(res.diff), file=sys.stderr)
+                    else:
+                        print('\n'.join(res.diff))
             elif res.status == 'not run':
                 notrun.append(name)
             elif res.status == 'pass':