diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-16 10:02:49 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-05-04 14:15:35 +0200 |
commit | 9ba5db49aea924175b8f23edd388fa2452206d20 (patch) | |
tree | 7f731141fcf0b54d8bd11855bb797d82e1bc718c | |
parent | 1b874108a514a359939d12e973ddbba2dcaa3abc (diff) | |
download | qemu-9ba5db49aea924175b8f23edd388fa2452206d20.zip qemu-9ba5db49aea924175b8f23edd388fa2452206d20.tar.gz qemu-9ba5db49aea924175b8f23edd388fa2452206d20.tar.bz2 |
glib-compat: accept G_TEST_SLOW environment variable
Provide an alternative way to pass the desired thoroughness of the
test.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | include/glib-compat.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/glib-compat.h b/include/glib-compat.h index 695a96f..4542e92 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -100,6 +100,23 @@ g_unix_get_passwd_entry_qemu(const gchar *user_name, GError **error) } #endif /* G_OS_UNIX */ +static inline bool +qemu_g_test_slow(void) +{ + static int cached = -1; + if (cached == -1) { + cached = g_test_slow() || getenv("G_TEST_SLOW") != NULL; + } + return cached; +} + +#undef g_test_slow +#undef g_test_thorough +#undef g_test_quick +#define g_test_slow() qemu_g_test_slow() +#define g_test_thorough() qemu_g_test_slow() +#define g_test_quick() (!qemu_g_test_slow()) + #pragma GCC diagnostic pop #endif |