tests/qtest: skip m48t59-test if the machine is absent
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 May 2024 08:48:56 +0000 (10:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 May 2024 13:47:39 +0000 (15:47 +0200)
Together with the series at https://patchew.org/QEMU/20240423131612.28362-1-pbonzini@redhat.com/,
this allows adding sparc-softmmu to the target list of the
build-without-defaults CI job.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/m48t59-test.c

index b9cd209165a72a74842666e749926434f1fd5a37..605797ab785d229fcf078f5c15151d79eead244b 100644 (file)
@@ -262,11 +262,12 @@ int main(int argc, char **argv)
     base_setup();
 
     g_test_init(&argc, &argv, NULL);
-
-    if (g_test_slow()) {
-        /* Do not run this in timing-sensitive environments */
-        qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
+    if (qtest_has_machine(base_machine)) {
+        if (g_test_slow()) {
+            /* Do not run this in timing-sensitive environments */
+            qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
+        }
+        qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     }
-    qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     return g_test_run();
 }