* [Qemu-devel] [PATCH for-2.11] tests/bios-tables: Silence some messages with V=1, print them with V=2 only
@ 2017-08-28 17:39 Thomas Huth
2017-08-30 13:48 ` Igor Mammedov
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2017-08-28 17:39 UTC (permalink / raw)
To: qemu-devel, Igor Mammedov, Michael S. Tsirkin; +Cc: qemu-trivial
When running "make check-qtest-x86_64 V=1", the output is currently flooded
with "Looking for expected file ..." and "Using expected file ..." messages.
None of the other tests is doing that with V=1, so this is a little bit
annoying. Let's only print these debug messages when we're running the test
with V=2 or higher.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/bios-tables-test.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 564da45..289ee45 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -40,6 +40,7 @@ typedef struct {
int required_struct_types_len;
} test_data;
+static bool really_verbose;
static char disk[] = "tests/acpi-test-disk-XXXXXX";
static const char *data_dir = "tests/acpi-test-data";
#ifdef CONFIG_IASL
@@ -395,7 +396,7 @@ static GArray *load_expected_aml(test_data *data)
try_again:
aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
(gchar *)&signature, ext);
- if (getenv("V")) {
+ if (really_verbose) {
fprintf(stderr, "\nLooking for expected file '%s'\n", aml_file);
}
if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
@@ -407,7 +408,7 @@ try_again:
goto try_again;
}
g_assert(exp_sdt.aml_file);
- if (getenv("V")) {
+ if (really_verbose) {
fprintf(stderr, "\nUsing expected file '%s'\n", aml_file);
}
ret = g_file_get_contents(aml_file, &exp_sdt.aml,
@@ -812,6 +813,11 @@ int main(int argc, char *argv[])
{
const char *arch = qtest_get_arch();
int ret;
+ const char *v_env = getenv("V");
+
+ if (v_env && *v_env >= '2') {
+ really_verbose = true;
+ }
ret = boot_sector_init(disk);
if(ret)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.11] tests/bios-tables: Silence some messages with V=1, print them with V=2 only
2017-08-28 17:39 [Qemu-devel] [PATCH for-2.11] tests/bios-tables: Silence some messages with V=1, print them with V=2 only Thomas Huth
@ 2017-08-30 13:48 ` Igor Mammedov
2017-08-31 13:35 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Igor Mammedov @ 2017-08-30 13:48 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Michael S. Tsirkin, qemu-trivial
On Mon, 28 Aug 2017 19:39:45 +0200
Thomas Huth <thuth@redhat.com> wrote:
> When running "make check-qtest-x86_64 V=1", the output is currently flooded
> with "Looking for expected file ..." and "Using expected file ..." messages.
> None of the other tests is doing that with V=1, so this is a little bit
> annoying. Let's only print these debug messages when we're running the test
> with V=2 or higher.
well, normally make check is run without V=
and if someone once in a while need to run it in verbose mode,
he/she can tolerate it since it's a verbose mode after all.
Hiding message behind V=XX is going to make us remember/recall
at which verbosity level one needs to run tests to get needed
diagnostic info.
I'd rather keep it as it is now.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/bios-tables-test.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
> index 564da45..289ee45 100644
> --- a/tests/bios-tables-test.c
> +++ b/tests/bios-tables-test.c
> @@ -40,6 +40,7 @@ typedef struct {
> int required_struct_types_len;
> } test_data;
>
> +static bool really_verbose;
> static char disk[] = "tests/acpi-test-disk-XXXXXX";
> static const char *data_dir = "tests/acpi-test-data";
> #ifdef CONFIG_IASL
> @@ -395,7 +396,7 @@ static GArray *load_expected_aml(test_data *data)
> try_again:
> aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
> (gchar *)&signature, ext);
> - if (getenv("V")) {
> + if (really_verbose) {
> fprintf(stderr, "\nLooking for expected file '%s'\n", aml_file);
> }
> if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
> @@ -407,7 +408,7 @@ try_again:
> goto try_again;
> }
> g_assert(exp_sdt.aml_file);
> - if (getenv("V")) {
> + if (really_verbose) {
> fprintf(stderr, "\nUsing expected file '%s'\n", aml_file);
> }
> ret = g_file_get_contents(aml_file, &exp_sdt.aml,
> @@ -812,6 +813,11 @@ int main(int argc, char *argv[])
> {
> const char *arch = qtest_get_arch();
> int ret;
> + const char *v_env = getenv("V");
> +
> + if (v_env && *v_env >= '2') {
> + really_verbose = true;
> + }
>
> ret = boot_sector_init(disk);
> if(ret)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.11] tests/bios-tables: Silence some messages with V=1, print them with V=2 only
2017-08-30 13:48 ` Igor Mammedov
@ 2017-08-31 13:35 ` Thomas Huth
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2017-08-31 13:35 UTC (permalink / raw)
To: Igor Mammedov; +Cc: qemu-devel, Michael S. Tsirkin, qemu-trivial, Peter Maydell
On 30.08.2017 15:48, Igor Mammedov wrote:
> On Mon, 28 Aug 2017 19:39:45 +0200
> Thomas Huth <thuth@redhat.com> wrote:
>
>> When running "make check-qtest-x86_64 V=1", the output is currently flooded
>> with "Looking for expected file ..." and "Using expected file ..." messages.
>> None of the other tests is doing that with V=1, so this is a little bit
>> annoying. Let's only print these debug messages when we're running the test
>> with V=2 or higher.
> well, normally make check is run without V=
> and if someone once in a while need to run it in verbose mode,
> he/she can tolerate it since it's a verbose mode after all.
>
> Hiding message behind V=XX is going to make us remember/recall
> at which verbosity level one needs to run tests to get needed
> diagnostic info.
>
> I'd rather keep it as it is now.
Well, I love to run the tests with V=1, especially as soon as one of the
tests hangs. But the output of the bios-tables-test really breaks the
well-formatted output of the test framework in that case, so adding a
V=2 debug level is IMHO a good idea. But if I'm the only who's annoyed
by the current output of the bios-tables-test, feel free to ignore me ;-)
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-31 13:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-28 17:39 [Qemu-devel] [PATCH for-2.11] tests/bios-tables: Silence some messages with V=1, print them with V=2 only Thomas Huth
2017-08-30 13:48 ` Igor Mammedov
2017-08-31 13:35 ` Thomas Huth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).