aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2021-12-20 09:10:52 +0100
committerThomas Huth <thuth@redhat.com>2021-12-22 08:13:05 +0100
commit9cbd66028b82c57f3f24399c6851f21495ccc775 (patch)
treea4e7e9fe7ff7706e77d210f838246fd6ebc1a6cd /tests
parentad9e129b0162a1342a407c8d8e2073e4562206f2 (diff)
tests/qtest: Improve endianness-test to work with missing machines and devices
The users might have built QEMU with less machines or without the i82378 superio device. Add some checks to the endianess-test so that it is able to deal with such stripped down QEMU versions, too. Message-Id: <20211220081054.151515-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/endianness-test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/qtest/endianness-test.c b/tests/qtest/endianness-test.c
index 09ecb531f1..9c03b72dc9 100644
--- a/tests/qtest/endianness-test.c
+++ b/tests/qtest/endianness-test.c
@@ -281,7 +281,10 @@ int main(int argc, char **argv)
for (i = 0; test_cases[i].arch; i++) {
gchar *path;
- if (strcmp(test_cases[i].arch, arch) != 0) {
+
+ if (!g_str_equal(test_cases[i].arch, arch) ||
+ !qtest_has_machine(test_cases[i].machine) ||
+ (test_cases[i].superio && !qtest_has_device(test_cases[i].superio))) {
continue;
}
path = g_strdup_printf("endianness/%s",