Skip to contentSkip to conversation

tests/qtest: skip m48t59-test if the machine is not absent

PATCH In review Paolo Bonzini 2 participants 2 messages May 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest: skip m48t59-test if the machine is not absent

Together with the series at https://patchew.org/QEMU/[email protected]/,
this allows adding sparc-softmmu to the target list of the
build-without-defaults CI job.

---
 tests/qtest/m48t59-test.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tests/qtest/m48t59-test.c +6 -5
index b9cd209165a..605797ab785 100644
@@ -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();
 }
Signature · 1 line
2.44.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Paolo Bonzini

Together with the series at https://patchew.org/QEMU/[email protected]/,
this allows adding sparc-softmmu to the target list of the
build-without-defaults CI job.

---
  tests/qtest/m48t59-test.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)

s/absent/present/ in subject.

r~

Quoted 23 lines
tests/qtest/m48t59-test.c +6 -5
index b9cd209165a..605797ab785 100644
@@ -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();
  }