[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] tests/bios-tables-test: Sanitize test verbose out
From: |
Thomas Huth |
Subject: |
Re: [Qemu-arm] [PATCH] tests/bios-tables-test: Sanitize test verbose output |
Date: |
Fri, 2 Nov 2018 22:03:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-10-30 00:18, Philippe Mathieu-Daudé wrote:
> Fix the extraneous extra blank lines in the test output when running with V=1.
>
> Before:
>
> TEST: tests/bios-tables-test... (pid=25678)
> /i386/acpi/piix4:
> Looking for expected file 'tests/acpi-test-data/pc/DSDT'
>
> Using expected file 'tests/acpi-test-data/pc/DSDT'
>
> Looking for expected file 'tests/acpi-test-data/pc/FACP'
>
> Using expected file 'tests/acpi-test-data/pc/FACP'
>
> Looking for expected file 'tests/acpi-test-data/pc/APIC'
>
> Using expected file 'tests/acpi-test-data/pc/APIC'
>
> Looking for expected file 'tests/acpi-test-data/pc/HPET'
>
> Using expected file 'tests/acpi-test-data/pc/HPET'
> OK
>
> After:
>
> TEST: tests/bios-tables-test... (pid=667)
> /i386/acpi/piix4:
> Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> Using expected file 'tests/acpi-test-data/pc/DSDT'
> Looking for expected file 'tests/acpi-test-data/pc/FACP'
> Using expected file 'tests/acpi-test-data/pc/FACP'
> Looking for expected file 'tests/acpi-test-data/pc/APIC'
> Using expected file 'tests/acpi-test-data/pc/APIC'
> Looking for expected file 'tests/acpi-test-data/pc/HPET'
> Using expected file 'tests/acpi-test-data/pc/HPET'
> OK
>
> Suggested-by: Peter Maydell <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> tests/bios-tables-test.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
> index 4e24930c4b..02dd48de0d 100644
> --- a/tests/bios-tables-test.c
> +++ b/tests/bios-tables-test.c
> @@ -371,6 +371,9 @@ static GArray *load_expected_aml(test_data *data)
> gboolean ret;
>
> GArray *exp_tables = g_array_new(false, true, sizeof(AcpiSdtTable));
> + if (getenv("V")) {
> + fputc('\n', stderr);
> + }
> for (i = 0; i < data->tables->len; ++i) {
> AcpiSdtTable exp_sdt;
> gchar *aml_file = NULL;
> @@ -385,7 +388,7 @@ try_again:
> aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
> (gchar *)&sdt->header.signature, ext);
> if (getenv("V")) {
> - fprintf(stderr, "\nLooking for expected file '%s'\n", aml_file);
> + fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
> }
> if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
> exp_sdt.aml_file = aml_file;
> @@ -397,7 +400,7 @@ try_again:
> }
> g_assert(exp_sdt.aml_file);
> if (getenv("V")) {
> - fprintf(stderr, "\nUsing expected file '%s'\n", aml_file);
> + fprintf(stderr, "Using expected file '%s'\n", aml_file);
> }
> ret = g_file_get_contents(aml_file, &exp_sdt.aml,
> &exp_sdt.aml_len, &error);
>
Could we please get rid of the getenv + fprintf here and use
g_test_message() instead, like we already do in most of the other tests
that want to log additional output?
Thomas