blob: ace3bb28e0e81e79c2d053dcb27302f9a27d94f2 [file] [log] [blame]
Gerd Hoffmann0850fd52014-04-28 11:01:13 +02001/*
2 * QTest testcase for vga cards
3 *
4 * Copyright (c) 2014 Red Hat, Inc
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
9
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020010#include "qemu/osdep.h"
Thomas Huthdd210742019-09-03 07:50:26 +020011#include "libqtest-single.h"
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020012
13static void pci_cirrus(void)
14{
15 qtest_start("-vga none -device cirrus-vga");
16 qtest_end();
17}
18
19static void pci_stdvga(void)
20{
21 qtest_start("-vga none -device VGA");
22 qtest_end();
23}
24
Gerd Hoffmanna889bc22014-04-28 11:02:58 +020025static void pci_secondary(void)
26{
27 qtest_start("-vga none -device secondary-vga");
28 qtest_end();
29}
30
31static void pci_multihead(void)
32{
33 qtest_start("-vga none -device VGA -device secondary-vga");
34 qtest_end();
35}
36
Gerd Hoffmann501eea42014-04-28 11:10:12 +020037static void pci_virtio_gpu(void)
38{
39 qtest_start("-vga none -device virtio-gpu-pci");
40 qtest_end();
41}
42
Gerd Hoffmann501eea42014-04-28 11:10:12 +020043static void pci_virtio_vga(void)
44{
45 qtest_start("-vga none -device virtio-vga");
46 qtest_end();
47}
Gerd Hoffmann501eea42014-04-28 11:10:12 +020048
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020049int main(int argc, char **argv)
50{
Laurent Vivierf38a0b22017-01-05 16:29:45 +010051 const char *arch = qtest_get_arch();
52
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020053 g_test_init(&argc, &argv, NULL);
54
Laurent Vivierf38a0b22017-01-05 16:29:45 +010055 if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
56 strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
57 qtest_add_func("/display/pci/cirrus", pci_cirrus);
58 }
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020059 qtest_add_func("/display/pci/stdvga", pci_stdvga);
Gerd Hoffmanna889bc22014-04-28 11:02:58 +020060 qtest_add_func("/display/pci/secondary", pci_secondary);
61 qtest_add_func("/display/pci/multihead", pci_multihead);
Gerd Hoffmann501eea42014-04-28 11:10:12 +020062 qtest_add_func("/display/pci/virtio-gpu", pci_virtio_gpu);
Thomas Huthc2077ec2018-11-29 12:50:48 +010063 if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64") ||
64 g_str_equal(arch, "hppa") || g_str_equal(arch, "ppc64")) {
65 qtest_add_func("/display/pci/virtio-vga", pci_virtio_vga);
66 }
67
Eduardo Habkost9be38592016-06-13 18:57:58 -030068 return g_test_run();
Gerd Hoffmann0850fd52014-04-28 11:01:13 +020069}