aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include80
-rw-r--r--tests/cdrom-test.c2
-rw-r--r--tests/display-vga-test.c10
-rw-r--r--tests/docker/dockerfiles/centos7.docker1
-rw-r--r--tests/docker/dockerfiles/fedora.docker1
-rw-r--r--tests/ivshmem-test.c5
-rw-r--r--tests/libqos/malloc.c2
-rw-r--r--tests/migration-test.c8
-rw-r--r--tests/tcg/alpha/test-cond.c4
-rw-r--r--tests/tcg/arm/hello-arm.c20
-rw-r--r--tests/tcg/cris/check_glibc_kernelversion.c8
-rw-r--r--tests/tcg/cris/check_mmap3.c2
-rw-r--r--tests/tcg/cris/check_openpf1.c2
-rw-r--r--tests/tcg/cris/check_settls1.c2
-rw-r--r--tests/tcg/i386/hello-i386.c14
-rw-r--r--tests/tcg/mips/hello-mips.c10
-rw-r--r--tests/tcg/multiarch/sha1.c12
-rw-r--r--tests/test-crypto-pbkdf.c3
-rw-r--r--tests/test-rcu-list.c2
-rw-r--r--tests/test-vmstate.c8
-rw-r--r--tests/vhost-user-test.c4
21 files changed, 116 insertions, 84 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index dfd87344bd..601ef4f64c 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -223,18 +223,23 @@ check-qtest-x86_64-y += $(check-qtest-i386-y)
check-qtest-x86_64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF)
check-qtest-alpha-y += tests/boot-serial-test$(EXESUF)
+check-qtest-alpha-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-hppa-y += tests/boot-serial-test$(EXESUF)
+check-qtest-hppa-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-m68k-y = tests/boot-serial-test$(EXESUF)
check-qtest-microblaze-y += tests/boot-serial-test$(EXESUF)
check-qtest-mips-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
+check-qtest-mips-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
+check-qtest-mips64-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
+check-qtest-mips64el-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-moxie-y += tests/boot-serial-test$(EXESUF)
@@ -811,41 +816,68 @@ tests/test-qga$(EXESUF): qemu-ga$(EXESUF)
tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
SPEED = quick
-GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
-GCOV_OPTIONS = -n $(if $(V),-f,)
# gtester tests, possibly with verbose output
+# do_test_tap runs all tests, even if some of them fail, while do_test_human
+# stops at the first failure unless -k is given on the command line
+
+define do_test_human_k
+ $(quiet-@)rc=0; $(foreach COMMAND, $1, \
+ $(call quiet-command-run, \
+ export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
+ $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
+ | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only) \
+ || rc=$$?;, "TEST", "$@: $(COMMAND)")) exit $$rc
+endef
+define do_test_human_no_k
+ $(foreach COMMAND, $1, \
+ $(call quiet-command, \
+ MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2 \
+ $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
+ | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only), \
+ "TEST", "$@: $(COMMAND)")
+)
+endef
+do_test_human = \
+ $(if $(findstring k, $(MAKEFLAGS)), $(do_test_human_k), $(do_test_human_no_k))
+
+define do_test_tap
+ $(call quiet-command, \
+ { export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
+ $(foreach COMMAND, $1, \
+ $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
+ | sed "s/^[a-z][a-z]* [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
+ | ./scripts/tap-merge.pl | tee "$@" \
+ | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only), \
+ "TAP","$@")
+endef
.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: subdir-%-softmmu $(check-qtest-y)
- $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
- QTEST_QEMU_IMG=qemu-img$(EXESUF) \
- MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} \
- gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER","$@")
+ $(call do_test_human,$(check-qtest-$*-y) $(check-qtest-generic-y), \
+ QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
+ QTEST_QEMU_IMG=qemu-img$(EXESUF))
-.PHONY: $(patsubst %, check-%, $(check-unit-y) $(check-speed-y))
-$(patsubst %, check-%, $(check-unit-y) $(check-speed-y)): check-%: %
- $(call quiet-command, \
- MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} \
- gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER","$*")
+check-unit: $(check-unit-y)
+ $(call do_test_human, $^)
-# gtester tests with XML output
+check-speed: $(check-speed-y)
+ $(call do_test_human, $^)
-$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
- $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
- QTEST_QEMU_IMG=qemu-img$(EXESUF) \
- gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER","$@")
+# gtester tests with TAP output
-check-report-unit.xml: $(check-unit-y)
- $(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^,"GTESTER","$@")
+$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: $(check-qtest-y)
+ $(call do_test_tap, $(check-qtest-$*-y) $(check-qtest-generic-y), \
+ QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
+ QTEST_QEMU_IMG=qemu-img$(EXESUF))
-# Reports and overall runs
+check-report-unit.tap: $(check-unit-y)
+ $(call do_test_tap,$^)
-check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
- $(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@,"GEN","$@")
+# Reports and overall runs
-check-report.html: check-report.xml
- $(call quiet-command,gtester-report $< > $@,"GEN","$@")
+check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
+ $(call quiet-command,./scripts/tap-merge.py $^ > $@,"GEN","$@")
# Per guest TCG tests
@@ -960,8 +992,6 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
.PHONY: check-qapi-schema check-qtest check-unit check check-clean
check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) check-tests/qapi-schema/doc-good.texi
check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
-check-unit: $(patsubst %,check-%, $(check-unit-y))
-check-speed: $(patsubst %,check-%, $(check-speed-y))
check-block: $(patsubst %,check-%, $(check-block-y))
check: check-qapi-schema check-unit check-qtest check-decodetree
check-clean:
diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c
index 9b43dc9ab4..14bd981336 100644
--- a/tests/cdrom-test.c
+++ b/tests/cdrom-test.c
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
if (exec_genisoimg(genisocheck)) {
/* genisoimage not available - so can't run tests */
- return 0;
+ return g_test_run();
}
ret = prepare_image(arch, isoimage);
diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
index 2d7d24eee0..bd176dcf3a 100644
--- a/tests/display-vga-test.c
+++ b/tests/display-vga-test.c
@@ -40,13 +40,11 @@ static void pci_virtio_gpu(void)
qtest_end();
}
-#ifdef CONFIG_VIRTIO_VGA
static void pci_virtio_vga(void)
{
qtest_start("-vga none -device virtio-vga");
qtest_end();
}
-#endif
int main(int argc, char **argv)
{
@@ -62,8 +60,10 @@ int main(int argc, char **argv)
qtest_add_func("/display/pci/secondary", pci_secondary);
qtest_add_func("/display/pci/multihead", pci_multihead);
qtest_add_func("/display/pci/virtio-gpu", pci_virtio_gpu);
-#ifdef CONFIG_VIRTIO_VGA
- qtest_add_func("/display/pci/virtio-vga", pci_virtio_vga);
-#endif
+ if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64") ||
+ g_str_equal(arch, "hppa") || g_str_equal(arch, "ppc64")) {
+ qtest_add_func("/display/pci/virtio-vga", pci_virtio_vga);
+ }
+
return g_test_run();
}
diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker
index 0a04bfbed8..e0f18f5a41 100644
--- a/tests/docker/dockerfiles/centos7.docker
+++ b/tests/docker/dockerfiles/centos7.docker
@@ -22,6 +22,7 @@ ENV PACKAGES \
mesa-libEGL-devel \
mesa-libgbm-devel \
nettle-devel \
+ perl-Test-Harness \
pixman-devel \
SDL-devel \
spice-glib-devel \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 0c4eb9e49c..1d0e3dc4ec 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -70,6 +70,7 @@ ENV PACKAGES \
nss-devel \
numactl-devel \
perl \
+ perl-Test-Harness \
pixman-devel \
python3 \
PyYAML \
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index 089e268154..fe5eb304b1 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -492,7 +492,7 @@ int main(int argc, char **argv)
/* shm */
tmpshm = mktempshm(TMPSHMSIZE, &fd);
if (!tmpshm) {
- return 0;
+ goto out;
}
tmpshmem = mmap(0, TMPSHMSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
g_assert(tmpshmem != MAP_FAILED);
@@ -514,9 +514,8 @@ int main(int argc, char **argv)
}
}
+out:
ret = g_test_run();
-
cleanup();
-
return ret;
}
diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c
index ac05874b0a..f7bae47a08 100644
--- a/tests/libqos/malloc.c
+++ b/tests/libqos/malloc.c
@@ -104,7 +104,7 @@ static void mlist_coalesce(MemList *head, MemBlock *node)
do {
merge = 0;
- left = QTAILQ_PREV(node, MemList, MLIST_ENTNAME);
+ left = QTAILQ_PREV(node, MLIST_ENTNAME);
right = QTAILQ_NEXT(node, MLIST_ENTNAME);
/* clowns to the left of me */
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 06ca5068d8..8352612364 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -789,7 +789,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
if (!ufd_version_check()) {
- return 0;
+ return g_test_run();
}
/*
@@ -800,7 +800,7 @@ int main(int argc, char **argv)
if (g_str_equal(qtest_get_arch(), "ppc64") &&
access("/sys/module/kvm_hv", F_OK)) {
g_test_message("Skipping test: kvm_hv not available");
- return 0;
+ return g_test_run();
}
/*
@@ -811,11 +811,11 @@ int main(int argc, char **argv)
#if defined(HOST_S390X)
if (access("/dev/kvm", R_OK | W_OK)) {
g_test_message("Skipping test: kvm not available");
- return 0;
+ return g_test_run();
}
#else
g_test_message("Skipping test: Need s390x host to work properly");
- return 0;
+ return g_test_run();
#endif
}
diff --git a/tests/tcg/alpha/test-cond.c b/tests/tcg/alpha/test-cond.c
index e625313b3e..3e11c4c105 100644
--- a/tests/tcg/alpha/test-cond.c
+++ b/tests/tcg/alpha/test-cond.c
@@ -6,7 +6,7 @@
int test_##N (long a) \
{ \
int res = 1; \
- \
+ \
asm ("cmov"#N" %1,$31,%0" \
: "+r" (res) : "r" (a)); \
return !res; \
@@ -18,7 +18,7 @@ int test_##N (long a) \
int test_##N (long a) \
{ \
int res = 1; \
- \
+ \
asm ("b"#N" %1,1f\n\t" \
"addq $31,$31,%0\n\t" \
"1: unop\n" \
diff --git a/tests/tcg/arm/hello-arm.c b/tests/tcg/arm/hello-arm.c
index e0daa7ad98..e33edf949f 100644
--- a/tests/tcg/arm/hello-arm.c
+++ b/tests/tcg/arm/hello-arm.c
@@ -11,7 +11,7 @@
#define __syscall_return(type, res) \
do { \
- return (type) (res); \
+ return (type) (res); \
} while (0)
#define _syscall0(type,name) \
@@ -33,7 +33,7 @@ type name(type1 arg1) { \
"mov %0,r0" \
: "=r" (__res) \
: "r" ((long)(arg1)) \
- : "r0","lr"); \
+ : "r0","lr"); \
__syscall_return(type,__res); \
}
@@ -47,7 +47,7 @@ type name(type1 arg1,type2 arg2) { \
"mov\t%0,r0" \
: "=r" (__res) \
: "r" ((long)(arg1)),"r" ((long)(arg2)) \
- : "r0","r1","lr"); \
+ : "r0","r1","lr"); \
__syscall_return(type,__res); \
}
@@ -78,9 +78,9 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
"mov\tr3,%4\n\t" \
__syscall(name) \
"mov\t%0,r0" \
- : "=r" (__res) \
- : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)) \
- : "r0","r1","r2","r3","lr"); \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)) \
+ : "r0","r1","r2","r3","lr"); \
__syscall_return(type,__res); \
}
@@ -96,10 +96,10 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
"mov\tr4,%5\n\t" \
__syscall(name) \
"mov\t%0,r0" \
- : "=r" (__res) \
- : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)), \
- "r" ((long)(arg5)) \
- : "r0","r1","r2","r3","r4","lr"); \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)), \
+ "r" ((long)(arg5)) \
+ : "r0","r1","r2","r3","r4","lr"); \
__syscall_return(type,__res); \
}
diff --git a/tests/tcg/cris/check_glibc_kernelversion.c b/tests/tcg/cris/check_glibc_kernelversion.c
index 07448722c0..7aada89911 100644
--- a/tests/tcg/cris/check_glibc_kernelversion.c
+++ b/tests/tcg/cris/check_glibc_kernelversion.c
@@ -109,8 +109,8 @@ int main(void)
if (parts < 3)
version <<= 8 * (3 - parts);
- if (version < __LINUX_KERNEL_VERSION)
- err();
- pass();
- exit(0);
+ if (version < __LINUX_KERNEL_VERSION)
+ err();
+ pass();
+ exit(0);
}
diff --git a/tests/tcg/cris/check_mmap3.c b/tests/tcg/cris/check_mmap3.c
index 34401fa0c9..cb890ef120 100644
--- a/tests/tcg/cris/check_mmap3.c
+++ b/tests/tcg/cris/check_mmap3.c
@@ -17,7 +17,7 @@ int main (int argc, char *argv[])
/* Check that we can map a non-multiple of a page and still get a full page. */
a = mmap (NULL, 0x4c, PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (a == NULL || a == (unsigned char *) -1)
abort ();
diff --git a/tests/tcg/cris/check_openpf1.c b/tests/tcg/cris/check_openpf1.c
index fdcf4c5c3f..251d26eec2 100644
--- a/tests/tcg/cris/check_openpf1.c
+++ b/tests/tcg/cris/check_openpf1.c
@@ -19,7 +19,7 @@ int main (int argc, char *argv[])
{
fnam = malloc (strlen (argv[0]) + 2);
if (fnam == NULL)
- abort ();
+ abort ();
strcpy (fnam, "/");
strcat (fnam, argv[0]);
}
diff --git a/tests/tcg/cris/check_settls1.c b/tests/tcg/cris/check_settls1.c
index 69d202652a..3abc3a9ea8 100644
--- a/tests/tcg/cris/check_settls1.c
+++ b/tests/tcg/cris/check_settls1.c
@@ -35,7 +35,7 @@ int main (void)
syscall (SYS_set_thread_area, old_tp);
if (tp != 0xeddeed00) {
- * (volatile int *) 0 = 0;
+ * (volatile int *) 0 = 0;
perror ("tls2");
abort ();
}
diff --git a/tests/tcg/i386/hello-i386.c b/tests/tcg/i386/hello-i386.c
index cfeb24b2f5..59196dd0b7 100644
--- a/tests/tcg/i386/hello-i386.c
+++ b/tests/tcg/i386/hello-i386.c
@@ -4,19 +4,19 @@ static inline void exit(int status)
{
int __res;
__asm__ volatile ("movl %%ecx,%%ebx\n"\
- "int $0x80" \
- : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status)));
+ "int $0x80" \
+ : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status)));
}
static inline int write(int fd, const char * buf, int len)
{
int status;
__asm__ volatile ("pushl %%ebx\n"\
- "movl %%esi,%%ebx\n"\
- "int $0x80\n" \
- "popl %%ebx\n"\
- : "=a" (status) \
- : "0" (__NR_write),"S" ((long)(fd)),"c" ((long)(buf)),"d" ((long)(len)));
+ "movl %%esi,%%ebx\n"\
+ "int $0x80\n" \
+ "popl %%ebx\n"\
+ : "=a" (status) \
+ : "0" (__NR_write),"S" ((long)(fd)),"c" ((long)(buf)),"d" ((long)(len)));
return status;
}
diff --git a/tests/tcg/mips/hello-mips.c b/tests/tcg/mips/hello-mips.c
index f8256730dd..c7052fdf2e 100644
--- a/tests/tcg/mips/hello-mips.c
+++ b/tests/tcg/mips/hello-mips.c
@@ -24,9 +24,9 @@ static inline void exit1(int status)
" syscall \n"
" .set pop "
:
- : "i" (__NR_exit), "r" (__a0)
- : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
- "memory");
+ : "i" (__NR_exit), "r" (__a0)
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
+ "memory");
}
static inline int write(int fd, const char *buf, int len)
@@ -46,8 +46,8 @@ static inline int write(int fd, const char *buf, int len)
" .set pop "
: "=r" (__v0), "=r" (__a3)
: "i" (__NR_write), "r" (__a0), "r" (__a1), "r" (__a2)
- : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
- "memory");
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
+ "memory");
/* if (__a3 == 0) */
return (int) __v0;
diff --git a/tests/tcg/multiarch/sha1.c b/tests/tcg/multiarch/sha1.c
index 93b7c8e808..87bfbcdf52 100644
--- a/tests/tcg/multiarch/sha1.c
+++ b/tests/tcg/multiarch/sha1.c
@@ -152,7 +152,7 @@ uint32_t j;
j = context->count[0];
if ((context->count[0] += len << 3) < j)
- context->count[1]++;
+ context->count[1]++;
context->count[1] += (len>>29);
j = (j >> 3) & 63;
if ((j + len) > 63) {
@@ -186,11 +186,11 @@ unsigned char c;
for (i = 0; i < 2; i++)
{
- uint32_t t = context->count[i];
- int j;
+ uint32_t t = context->count[i];
+ int j;
- for (j = 0; j < 4; t >>= 8, j++)
- *--fcp = (unsigned char) t;
+ for (j = 0; j < 4; t >>= 8, j++)
+ *--fcp = (unsigned char) t;
}
#else
for (i = 0; i < 8; i++) {
@@ -201,7 +201,7 @@ unsigned char c;
c = 0200;
SHA1Update(context, &c, 1);
while ((context->count[0] & 504) != 448) {
- c = 0000;
+ c = 0000;
SHA1Update(context, &c, 1);
}
SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
diff --git a/tests/test-crypto-pbkdf.c b/tests/test-crypto-pbkdf.c
index d937aff6b2..85ed1f9b33 100644
--- a/tests/test-crypto-pbkdf.c
+++ b/tests/test-crypto-pbkdf.c
@@ -440,6 +440,7 @@ int main(int argc, char **argv)
#else
int main(int argc, char **argv)
{
- return 0;
+ g_test_init(&argc, &argv, NULL);
+ return g_test_run();
}
#endif
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 2e6f70bd59..6f076473e0 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -108,7 +108,7 @@ static void reclaim_list_el(struct rcu_head *prcu)
}
#if TEST_LIST_TYPE == 1
-static QLIST_HEAD(q_list_head, list_element) Q_list_head;
+static QLIST_HEAD(, list_element) Q_list_head;
#define TEST_NAME "qlist"
#define TEST_LIST_REMOVE_RCU QLIST_REMOVE_RCU
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index 37a7a93784..0ab29a8216 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -630,7 +630,7 @@ struct TestQtailqElement {
typedef struct TestQtailq {
int16_t i16;
- QTAILQ_HEAD(TestQtailqHead, TestQtailqElement) q;
+ QTAILQ_HEAD(, TestQtailqElement) q;
int32_t i32;
} TestQtailq;
@@ -735,9 +735,9 @@ static void test_load_q(void)
g_assert_cmpint(eof, ==, QEMU_VM_EOF);
TestQtailqElement *qele_from = QTAILQ_FIRST(&obj_q.q);
- TestQtailqElement *qlast_from = QTAILQ_LAST(&obj_q.q, TestQtailqHead);
+ TestQtailqElement *qlast_from = QTAILQ_LAST(&obj_q.q);
TestQtailqElement *qele_to = QTAILQ_FIRST(&tgt.q);
- TestQtailqElement *qlast_to = QTAILQ_LAST(&tgt.q, TestQtailqHead);
+ TestQtailqElement *qlast_to = QTAILQ_LAST(&tgt.q);
while (1) {
g_assert_cmpint(qele_to->b, ==, qele_from->b);
@@ -755,7 +755,7 @@ static void test_load_q(void)
/* clean up */
TestQtailqElement *qele;
while (!QTAILQ_EMPTY(&tgt.q)) {
- qele = QTAILQ_LAST(&tgt.q, TestQtailqHead);
+ qele = QTAILQ_LAST(&tgt.q);
QTAILQ_REMOVE(&tgt.q, qele, next);
free(qele);
qele = NULL;
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 45d58d8ea2..54982f68e7 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -354,8 +354,8 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
break;
case VHOST_USER_SET_FEATURES:
- g_assert_cmpint(msg.payload.u64 & (0x1ULL << VHOST_USER_F_PROTOCOL_FEATURES),
- !=, 0ULL);
+ g_assert_cmpint(msg.payload.u64 & (0x1ULL << VHOST_USER_F_PROTOCOL_FEATURES),
+ !=, 0ULL);
if (s->test_flags == TEST_FLAGS_DISCONNECT) {
qemu_chr_fe_disconnect(chr);
s->test_flags = TEST_FLAGS_BAD;