summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-05-03 10:48:56 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-03 15:47:39 +0200
commit969ce22123681694a9c241aed3f649185a9e067b (patch)
tree314f33998a9622c8ae75f07f550e3aaa304d5bf3
parent5ce77fcb1b8480f35a1008d5500197d4b73f9ef6 (diff)
downloadfocaccia-qemu-969ce22123681694a9c241aed3f649185a9e067b.tar.gz
focaccia-qemu-969ce22123681694a9c241aed3f649185a9e067b.zip
tests/qtest: skip m48t59-test if the machine is absent
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>
-rw-r--r--tests/qtest/m48t59-test.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/qtest/m48t59-test.c b/tests/qtest/m48t59-test.c
index b9cd209165..605797ab78 100644
--- a/tests/qtest/m48t59-test.c
+++ b/tests/qtest/m48t59-test.c
@@ -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();
 }