Philippe Mathieu-Daudé <phi...@redhat.com> writes:
> Now than we can probe if the TCG accelerator is available > at runtime with a QMP command, do it once at the beginning > and only register the tests we can run. > We can then replace the #ifdef'ry by an assertion. > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> > --- > Since v1: use global tcg_accel_available, call qtest_has_accel() once > --- > tests/qtest/bios-tables-test.c | 99 ++++++++++++++++++---------------- > 1 file changed, 52 insertions(+), 47 deletions(-) > > diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c > index 156d4174aa3..a4c7bddf6f3 100644 > --- a/tests/qtest/bios-tables-test.c > +++ b/tests/qtest/bios-tables-test.c > @@ -97,6 +97,7 @@ typedef struct { > QTestState *qts; > } test_data; > > +static bool tcg_accel_available; > static char disk[] = "tests/acpi-test-disk-XXXXXX"; > static const char *data_dir = "tests/data/acpi"; > #ifdef CONFIG_IASL > @@ -718,15 +719,11 @@ static void test_acpi_one(const char *params, test_data > *data) > char *args; > bool use_uefi = data->uefi_fl1 && data->uefi_fl2; > > -#ifndef CONFIG_TCG > - if (data->tcg_only) { > - g_test_skip("TCG disabled, skipping ACPI tcg_only test"); > - return; > - } > -#endif /* CONFIG_TCG */ > + assert(!data->tcg_only || tcg_accel_available); I find it odd that we need TCG here (especially on an x86 system) to test what are essentially device models we use in KVM. On the other hand it maintains the current effect with less ifdef hacks so: Reviewed-by: Alex Bennée <alex.ben...@linaro.org> -- Alex Bennée