diff options
| author | Marc MarĂ | 2014-08-12 13:41:48 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-08-15 19:03:14 +0200 |
| commit | ae74f18782d83c249e8bb9566bf5a2ad501ab82c (patch) | |
| tree | 87faa8df96f806be1dc59eaf4a4745af3095bce3 /tests | |
| parent | ide: Fix segfault when flushing a device that doesn't exist (diff) | |
| download | qemu-ae74f18782d83c249e8bb9566bf5a2ad501ab82c.tar.gz qemu-ae74f18782d83c249e8bb9566bf5a2ad501ab82c.tar.xz qemu-ae74f18782d83c249e8bb9566bf5a2ad501ab82c.zip | |
libqtest: add QTEST_LOG for debugging qtest testcases
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marc MarĂ <marc.mari.barcelo@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/libqtest.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c index 0bf17aa8cd..ed55686ce0 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -402,10 +402,14 @@ QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap) /* No need to send anything for an empty QObject. */ if (qobj) { + int log = getenv("QTEST_LOG") != NULL; QString *qstr = qobject_to_json(qobj); const char *str = qstring_get_str(qstr); size_t size = qstring_get_length(qstr); + if (log) { + fprintf(stderr, "%s", str); + } /* Send QMP request */ socket_send(s->qmp_fd, str, size); |
