From: Thomas Huth Date: Wed, 9 Feb 2022 10:15:29 +0000 (+0100) Subject: tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode X-Git-Tag: v7.0.0-rc0~46^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=308c8475bc9d7e352125dea42950afbaf9daadfe;p=thirdparty%2Fqemu.git tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode 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 Message-Id: <20220209101530.3442837-8-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py index 0eace147b8f..9a942739754 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -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':