mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
tests/qtest/qom-test: Stop spamming the test log
We are still facing the issues that our test logs in the gitlab CI are too big (and thus cut off). A huge part is still caused by the qom-test that prints the path and name of each object it looks at by default. That's too much. Let's be silent by default, and only print the object path+name when running with V=2 (and the properties only with V=3 and higher). Message-Id: <20230118122557.1668860-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
c95031a19f
commit
e549227408
1 changed files with 7 additions and 5 deletions
|
@ -14,7 +14,7 @@
|
||||||
#include "qemu/cutils.h"
|
#include "qemu/cutils.h"
|
||||||
#include "libqtest.h"
|
#include "libqtest.h"
|
||||||
|
|
||||||
static bool verbose;
|
static int verbosity_level;
|
||||||
|
|
||||||
static void test_properties(QTestState *qts, const char *path, bool recurse)
|
static void test_properties(QTestState *qts, const char *path, bool recurse)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,9 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
|
||||||
QListEntry *entry;
|
QListEntry *entry;
|
||||||
GSList *children = NULL, *links = NULL;
|
GSList *children = NULL, *links = NULL;
|
||||||
|
|
||||||
|
if (verbosity_level >= 2) {
|
||||||
g_test_message("Obtaining properties of %s", path);
|
g_test_message("Obtaining properties of %s", path);
|
||||||
|
}
|
||||||
response = qtest_qmp(qts, "{ 'execute': 'qom-list',"
|
response = qtest_qmp(qts, "{ 'execute': 'qom-list',"
|
||||||
" 'arguments': { 'path': %s } }", path);
|
" 'arguments': { 'path': %s } }", path);
|
||||||
g_assert(response);
|
g_assert(response);
|
||||||
|
@ -51,7 +53,7 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const char *prop = qdict_get_str(tuple, "name");
|
const char *prop = qdict_get_str(tuple, "name");
|
||||||
if (verbose) {
|
if (verbosity_level >= 3) {
|
||||||
g_test_message("-> %s", prop);
|
g_test_message("-> %s", prop);
|
||||||
}
|
}
|
||||||
tmp = qtest_qmp(qts,
|
tmp = qtest_qmp(qts,
|
||||||
|
@ -109,8 +111,8 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *v_env = getenv("V");
|
char *v_env = getenv("V");
|
||||||
|
|
||||||
if (v_env && atoi(v_env) >= 2) {
|
if (v_env) {
|
||||||
verbose = true;
|
verbosity_level = atoi(v_env);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_test_init(&argc, &argv, NULL);
|
g_test_init(&argc, &argv, NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue