aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stubs/error-printf.c3
-rw-r--r--tests/test-vmstate.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/stubs/error-printf.c b/stubs/error-printf.c
index ac6b92aa69..99c6406668 100644
--- a/stubs/error-printf.c
+++ b/stubs/error-printf.c
@@ -4,7 +4,8 @@
void error_vprintf(const char *fmt, va_list ap)
{
- if (g_test_initialized() && !g_test_subprocess()) {
+ if (g_test_initialized() && !g_test_subprocess() &&
+ getenv("QTEST_SILENT_ERRORS")) {
char *msg = g_strdup_vprintf(fmt, ap);
g_test_message("%s", msg);
g_free(msg);
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index 087844b6c8..37a7a93784 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -859,6 +859,8 @@ int main(int argc, char **argv)
module_call_init(MODULE_INIT_QOM);
+ setenv("QTEST_SILENT_ERRORS", "1", 1);
+
g_test_init(&argc, &argv, NULL);
g_test_add_func("/vmstate/simple/primitive", test_simple_primitive);
g_test_add_func("/vmstate/versioned/load/v1", test_load_v1);