- qtest fixes

- Some generic clean-ups by Philippe
 - macOS CI testing via cirrus-ci.com
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJcgi7HAAoJEC7Z13T+cC21Y00P/1/m7FcVVfMlDw85+rYjkUri
 QWPvWUORhGbAkv87AfsFezCzoO/n3KX+AefPDWbnIM1Ixt8MvS/8zPOWAXwHUKVy
 ira5jP7CNJDPGr13qoO0lNrvU5cmxRWdmLOMbMsqW3Aparc5RBgDPn0bvcm5l2vX
 i90fdxpXvpQ/FgoX0J1j//awa3JXf94pijBb3pL985qXI670ZkRq13JIlmVZ1+Gw
 Fmx4XvpIwajo2HM1G+CcG8ElAxTgYmjC9bkKJW1fddOkwP7wRnZtAdLZpRTzojCb
 CUNBaTSM/xjinVzOhwgiHFtak/ZMOdUZrGjrbin1e/p+Xppw75P7FdUoiSnJNhga
 BJr8LbGcJwcIXfpMdEw7ZGlWACd+D0+G7363jNWOPyff3by6xx4gdCrBsYc4qwSR
 MJ8Wyb5o4oSisUg06VxghGyPTE/xBgog/YgLb4Bu6FXjCPKsl0mKQMxG0ROZLvT+
 dFiaHeeCKEn7Yw6OkdqW9Sa1uGfna7gRCC7hZErDA3URe+02dUBb4VCtnjAaCLx3
 0Jq8jpb2T57N8roP23QFQBxA+Y859qlZPrWzwRqbgdADZCnFsSJlmBxjDmhbYuF0
 4qAQtGFTgdmhjdG/FjJkcMQkCcx4h6V62kqi8HtP+vCd43SFwLPqHH/HKq5cU/Zt
 YIXF2oo6z5k7iqx1H26G
 =DEp5
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-03-08' into staging

- qtest fixes
- Some generic clean-ups by Philippe
- macOS CI testing via cirrus-ci.com

# gpg: Signature made Fri 08 Mar 2019 08:58:47 GMT
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-03-08:
  cirrus.yml: Add macOS continuous integration task
  tests/bios-tables: Improve portability by searching bash in the $PATH
  vhost-user-test: fix leaks
  tests: Do not use "\n" in g_test_message() strings
  hw/devices: Remove unused TC6393XB_RAM definition
  hw: Remove unused 'hw/devices.h' include
  tests: Move qdict-test-data.txt to tests/data/qobject/

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

# Conflicts:
#	tests/vhost-user-test.c
This commit is contained in:
Peter Maydell 2019-03-08 16:31:34 +00:00
commit 234afe7828
38 changed files with 44 additions and 56 deletions

View File

@ -1,10 +1,11 @@
env:
CIRRUS_CLONE_DEPTH: 1
freebsd_12_task:
freebsd_instance:
image: freebsd-12-0-release-amd64
cpu: 8
memory: 8G
env:
CIRRUS_CLONE_DEPTH: 1
install_script: pkg install -y
bison curl cyrus-sasl git glib gmake gnutls
nettle perl5 pixman pkgconf png usbredir
@ -14,3 +15,13 @@ freebsd_12_task:
- ../configure || { cat config.log; exit 1; }
- gmake -j8
- gmake -j8 V=1 check
macos_task:
osx_instance:
image: mojave-base
install_script:
- brew install pkg-config python glib pixman make sdl2
script:
- ./configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; }
- gmake -j$(sysctl -n hw.ncpu)
- gmake check -j$(sysctl -n hw.ncpu)

View File

@ -1965,7 +1965,7 @@ F: tests/check-qnull.c
F: tests/check-qnum.c
F: tests/check-qobject.c
F: tests/check-qstring.c
F: qdict-test-data.txt
F: tests/data/qobject/qdict.txt
T: git https://repo.or.cz/qemu/armbru.git qapi-next
QEMU Guest Agent

2
configure vendored
View File

@ -7737,7 +7737,7 @@ DIRS="$DIRS tests/fp tests/qgraph"
DIRS="$DIRS docs docs/interop fsdev scsi"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios roms/vgabios"
LINKS="Makefile tests/tcg/Makefile qdict-test-data.txt"
LINKS="Makefile tests/tcg/Makefile"
LINKS="$LINKS tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
LINKS="$LINKS tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile"
LINKS="$LINKS tests/fp/Makefile"

View File

@ -11,7 +11,6 @@
#include "qapi/error.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "alpha_sys.h"
#include "exec/address-spaces.h"

View File

@ -20,7 +20,6 @@
#include "qemu-common.h"
#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/devices.h"
#include "hw/arm/allwinner-a10.h"
#include "hw/misc/unimp.h"

View File

@ -12,7 +12,6 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "hw/boards.h"
#include "hw/devices.h"
#include "strongarm.h"
#include "hw/arm/arm.h"
#include "hw/block/flash.h"

View File

@ -20,7 +20,6 @@
#include "qemu-common.h"
#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/arm/allwinner-a10.h"

View File

@ -21,7 +21,6 @@
#include "qapi/error.h"
#include "hw/sysbus.h"
#include "hw/arm/arm.h"
#include "hw/devices.h"
#include "hw/loader.h"
#include "net/net.h"
#include "sysemu/kvm.h"

View File

@ -56,7 +56,6 @@
#include "hw/arm/armsse.h"
#include "hw/dma/pl080.h"
#include "hw/ssi/pl022.h"
#include "hw/devices.h"
#include "net/net.h"
#include "hw/core/split-irq.h"

View File

@ -15,7 +15,6 @@
#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/arm/arm.h"
#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"

View File

@ -14,7 +14,6 @@
#include "hw/arm/arm.h"
#include "hw/sysbus.h"
#include "hw/boards.h"
#include "hw/devices.h"
#include "hw/misc/unimp.h"
#include "exec/address-spaces.h"
#include "sysemu/sysemu.h"

View File

@ -21,7 +21,6 @@
#include "hw/ssi/ssi.h"
#include "hw/block/flash.h"
#include "qemu/timer.h"
#include "hw/devices.h"
#include "hw/arm/sharpsl.h"
#include "ui/console.h"
#include "hw/audio/wm8750.h"

View File

@ -38,7 +38,6 @@
#include "hw/vfio/vfio-calxeda-xgmac.h"
#include "hw/vfio/vfio-amd-xgbe.h"
#include "hw/display/ramfb.h"
#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/device_tree.h"
#include "sysemu/numa.h"

View File

@ -15,7 +15,6 @@
#include "hw/hw.h"
#include "hw/arm/pxa.h"
#include "hw/arm/arm.h"
#include "hw/devices.h"
#include "hw/i2c/i2c.h"
#include "hw/ssi/ssi.h"
#include "hw/boards.h"

View File

@ -32,7 +32,6 @@
#include "hw/hw.h"
#include "hw/char/serial.h"
#include "ui/console.h"
#include "hw/devices.h"
#include "hw/sysbus.h"
#include "hw/pci/pci.h"
#include "hw/i2c/i2c.h"

View File

@ -15,7 +15,6 @@
#include "qapi/error.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"

View File

@ -17,7 +17,6 @@
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "hw/intc/allwinner-a10-pic.h"
#include "qemu/log.h"

View File

@ -25,7 +25,6 @@
#include "hw/sysbus.h"
#include "hw/hw.h"
#include "hw/block/flash.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "elf.h"

View File

@ -27,7 +27,6 @@
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
#include "sysemu/qtest.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "elf.h"

View File

@ -35,7 +35,6 @@
#include "net/net.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/char/serial.h"
#include "exec/address-spaces.h"

View File

@ -33,7 +33,6 @@
#include "net/net.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/misc/unimp.h"
#include "exec/address-spaces.h"

View File

@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "hw/devices.h"
#include "net/net.h"
#include "qapi/error.h"
#include "qemu/timer.h"

View File

@ -31,7 +31,6 @@
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
#include "sysemu/qtest.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "sysemu/device_tree.h"
#include "hw/loader.h"

View File

@ -31,7 +31,6 @@
#include "hw/sysbus.h"
#include "hw/hw.h"
#include "hw/sh4/sh.h"
#include "hw/devices.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/pci/pci.h"

View File

@ -24,7 +24,6 @@
#include "qemu-common.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/devices.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"

View File

@ -24,7 +24,6 @@
#include "hw/usb.h"
#include "hw/arm/omap.h"
#include "hw/irq.h"
#include "hw/devices.h"
#include "hw/sysbus.h"
#define TYPE_TUSB6010 "tusb6010"

View File

@ -52,7 +52,6 @@ void retu_key_event(void *retu, int state);
/* tc6393xb.c */
typedef struct TC6393xbState TC6393xbState;
#define TC6393XB_RAM 0x110000 /* amount of ram for Video and USB */
TC6393xbState *tc6393xb_init(struct MemoryRegion *sysmem,
uint32_t base, qemu_irq irq);
void tc6393xb_gpio_out_set(TC6393xbState *s, int line,

View File

@ -291,7 +291,7 @@ static void qdict_stress_test(void)
FILE *test_file;
QDict *qdict;
QString *value;
const char *test_file_path = "qdict-test-data.txt";
const char *test_file_path = "tests/data/qobject/qdict.txt";
test_file = fopen(test_file_path, "r");
g_assert(test_file != NULL);

View File

@ -1,4 +1,4 @@
#! /bin/bash
#!/usr/bin/env bash
#
# Rebuild expected AML files for acpi unit-test

View File

@ -74,7 +74,7 @@ static inline unsigned in_reg(IVState *s, enum Reg reg)
unsigned res;
res = qpci_io_readl(s->dev, s->reg_bar, reg);
g_test_message("*%s -> %x\n", name, res);
g_test_message("*%s -> %x", name, res);
return res;
}
@ -83,7 +83,7 @@ static inline void out_reg(IVState *s, enum Reg reg, unsigned v)
{
const char *name = reg2str(reg);
g_test_message("%x -> *%s\n", v, name);
g_test_message("%x -> *%s", v, name);
qpci_io_writel(s->dev, s->reg_bar, reg, v);
}

View File

@ -199,9 +199,9 @@ static void bcd_check_time(void)
t = (long)mktime(datep);
s = (long)mktime(&start);
if (t < s) {
g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t));
g_test_message("RTC is %ld second(s) behind wall-clock", (s - t));
} else {
g_test_message("RTC is %ld second(s) ahead of wall-clock\n", (t - s));
g_test_message("RTC is %ld second(s) ahead of wall-clock", (t - s));
}
g_assert_cmpint(ABS(t - s), <=, wiggle);

View File

@ -1066,7 +1066,7 @@ int main(int argc, char **argv)
tmpfs = mkdtemp(template);
if (!tmpfs) {
g_test_message("mkdtemp on path (%s): %s\n", template, strerror(errno));
g_test_message("mkdtemp on path (%s): %s", template, strerror(errno));
}
g_assert(tmpfs);
@ -1087,7 +1087,7 @@ int main(int argc, char **argv)
ret = rmdir(tmpfs);
if (ret != 0) {
g_test_message("unable to rmdir: path (%s): %s\n",
g_test_message("unable to rmdir: path (%s): %s",
tmpfs, strerror(errno));
}

View File

@ -165,9 +165,9 @@ static void check_time(int wiggle)
t = (long)mktime(datep);
s = (long)mktime(&start);
if (t < s) {
g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t));
g_test_message("RTC is %ld second(s) behind wall-clock", (s - t));
} else {
g_test_message("RTC is %ld second(s) ahead of wall-clock\n", (t - s));
g_test_message("RTC is %ld second(s) ahead of wall-clock", (t - s));
}
g_assert_cmpint(ABS(t - s), <=, wiggle);

View File

@ -46,12 +46,12 @@ static QPCIDevice *get_device(void)
static unsigned __attribute__((unused)) in_##name(void) \
{ \
unsigned res = qpci_io_read##len(dev, dev_bar, (val)); \
g_test_message("*%s -> %x\n", #name, res); \
g_test_message("*%s -> %x", #name, res); \
return res; \
} \
static void out_##name(unsigned v) \
{ \
g_test_message("%x -> *%s\n", v, #name); \
g_test_message("%x -> *%s", v, #name); \
qpci_io_write##len(dev, dev_bar, (val), v); \
}
@ -176,7 +176,7 @@ static void test_timer(void)
}
}
g_test_message("Everythink is ok!\n");
g_test_message("Everythink is ok!");
}

View File

@ -178,7 +178,7 @@ static void test_multi_co_schedule(int seconds)
}
join_aio_contexts();
g_test_message("scheduled %d, queued %d, retry %d, total %d\n",
g_test_message("scheduled %d, queued %d, retry %d, total %d",
count_other, count_here, count_retry,
count_here + count_other + count_retry);
}
@ -242,7 +242,7 @@ static void test_multi_co_mutex(int threads, int seconds)
}
join_aio_contexts();
g_test_message("%d iterations/second\n", counter / seconds);
g_test_message("%d iterations/second", counter / seconds);
g_assert_cmpint(counter, ==, atomic_counter);
}
@ -361,7 +361,7 @@ static void test_multi_fair_mutex(int threads, int seconds)
}
join_aio_contexts();
g_test_message("%d iterations/second\n", counter / seconds);
g_test_message("%d iterations/second", counter / seconds);
g_assert_cmpint(counter, ==, atomic_counter);
}
@ -417,7 +417,7 @@ static void test_multi_mutex(int threads, int seconds)
}
join_aio_contexts();
g_test_message("%d iterations/second\n", counter / seconds);
g_test_message("%d iterations/second", counter / seconds);
g_assert_cmpint(counter, ==, atomic_counter);
}

View File

@ -369,7 +369,7 @@ static void perf_lifecycle(void)
}
duration = g_test_timer_elapsed();
g_test_message("Lifecycle %u iterations: %f s\n", max, duration);
g_test_message("Lifecycle %u iterations: %f s", max, duration);
}
static void perf_nesting(void)
@ -393,7 +393,7 @@ static void perf_nesting(void)
}
duration = g_test_timer_elapsed();
g_test_message("Nesting %u iterations of %u depth each: %f s\n",
g_test_message("Nesting %u iterations of %u depth each: %f s",
maxcycles, maxnesting, duration);
}
@ -426,8 +426,7 @@ static void perf_yield(void)
}
duration = g_test_timer_elapsed();
g_test_message("Yield %u iterations: %f s\n",
maxcycles, duration);
g_test_message("Yield %u iterations: %f s", maxcycles, duration);
}
static __attribute__((noinline)) void dummy(unsigned *i)
@ -449,8 +448,7 @@ static void perf_baseline(void)
}
duration = g_test_timer_elapsed();
g_test_message("Function call %u iterations: %f s\n",
maxcycles, duration);
g_test_message("Function call %u iterations: %f s", maxcycles, duration);
}
static __attribute__((noinline)) void perf_cost_func(void *opaque)

View File

@ -294,7 +294,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
}
if (size != VHOST_USER_HDR_SIZE) {
g_test_message("Wrong message size received %d\n", size);
g_test_message("Wrong message size received %d", size);
return;
}
@ -305,7 +305,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
p += VHOST_USER_HDR_SIZE;
size = qemu_chr_fe_read_all(chr, p, msg.size);
if (size != msg.size) {
g_test_message("Wrong message size received %d != %d\n",
g_test_message("Wrong message size received %d != %d",
size, msg.size);
return;
}
@ -437,7 +437,7 @@ static const char *init_hugepagefs(void)
}
if (access(path, R_OK | W_OK | X_OK)) {
g_test_message("access on path (%s): %s\n", path, strerror(errno));
g_test_message("access on path (%s): %s", path, strerror(errno));
g_test_fail();
return NULL;
}
@ -447,13 +447,13 @@ static const char *init_hugepagefs(void)
} while (ret != 0 && errno == EINTR);
if (ret != 0) {
g_test_message("statfs on path (%s): %s\n", path, strerror(errno));
g_test_message("statfs on path (%s): %s", path, strerror(errno));
g_test_fail();
return NULL;
}
if (fs.f_type != HUGETLBFS_MAGIC) {
g_test_message("Warning: path not on HugeTLBFS: %s\n", path);
g_test_message("Warning: path not on HugeTLBFS: %s", path);
g_test_fail();
return NULL;
}
@ -549,6 +549,7 @@ static void test_server_free(TestServer *server)
g_test_message("unable to rmdir: path (%s): %s",
server->tmpfs, strerror(errno));
}
g_free(server->tmpfs);
qemu_chr_fe_deinit(&server->chr, true);
@ -564,6 +565,8 @@ static void test_server_free(TestServer *server)
g_main_loop_unref(server->loop);
g_main_context_unref(server->context);
g_cond_clear(&server->data_cond);
g_mutex_clear(&server->data_mutex);
g_free(server);
}