mirror of
https://gitlab.gnome.org/GNOME/libmks.git
synced 2024-12-22 05:35:21 +00:00
Merge branch 'libmks-functional_test' into 'main'
tests: add functional test See merge request GNOME/libmks!41
This commit is contained in:
commit
058c1f4fb0
@ -7,6 +7,30 @@ stages:
|
|||||||
- docs
|
- docs
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
tests:
|
||||||
|
image: fedora:rawhide
|
||||||
|
stage: test
|
||||||
|
variables:
|
||||||
|
MESON_FLAGS: "-Db_coverage=true -Ddocs=false -Dvapi=false -Dintrospection=disabled"
|
||||||
|
before_script:
|
||||||
|
- sudo dnf install -y git gtk4-devel libepoxy-devel meson gcc lcov wget
|
||||||
|
qemu-system-x86 qemu-ui-dbus qemu-ui-opengl
|
||||||
|
dbus-x11 xorg-x11-server-Xvfb
|
||||||
|
script:
|
||||||
|
- meson setup _build
|
||||||
|
- meson configure ${MESON_FLAGS} _build
|
||||||
|
- meson compile -C _build
|
||||||
|
- meson test -C _build --suit "libmks"
|
||||||
|
- cd tests
|
||||||
|
- BUILDDIR=_build xvfb-run ./functional.sh
|
||||||
|
- cd ..
|
||||||
|
- rm -rf _build/subprojects
|
||||||
|
- ninja coverage-html -C _build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- _build/meson-logs/coveragereport
|
||||||
|
|
||||||
|
|
||||||
flatpak:
|
flatpak:
|
||||||
variables:
|
variables:
|
||||||
BUNDLE: "mks-test-widget-dev.flatpak"
|
BUNDLE: "mks-test-widget-dev.flatpak"
|
||||||
@ -17,13 +41,13 @@ flatpak:
|
|||||||
extends: ".flatpak"
|
extends: ".flatpak"
|
||||||
|
|
||||||
reference:
|
reference:
|
||||||
image: fedora:38
|
image: fedora:rawhide
|
||||||
stage: docs
|
stage: docs
|
||||||
needs: []
|
|
||||||
variables:
|
variables:
|
||||||
MESON_FLAGS: "--buildtype=release -Dgtk:gtk_doc=false -Dgtk:introspection=disabled -Dgtk:build-examples=false -Dgtk:build-tests=false -Dgtk:demos=false -Dgtk:media-gstreamer=disabled -Dlibepoxy:tests=false"
|
MESON_FLAGS: "--buildtype=release -Ddocs=true -Dintrospection=enabled"
|
||||||
before_script:
|
before_script:
|
||||||
- sudo dnf install -y git gtk4-devel meson gcc gcc-c++ gi-docgen gobject-introspection-devel vala
|
- sudo dnf install -y git gtk4-devel libepoxy-devel meson gcc
|
||||||
|
gi-docgen gobject-introspection-devel vala
|
||||||
script:
|
script:
|
||||||
- mkdir -p pfx/
|
- mkdir -p pfx/
|
||||||
- meson ${MESON_FLAGS} --prefix=${PWD}/pfx -Ddocs=true _build
|
- meson ${MESON_FLAGS} --prefix=${PWD}/pfx -Ddocs=true _build
|
||||||
|
@ -153,7 +153,7 @@ pkg.generate(
|
|||||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
||||||
)
|
)
|
||||||
|
|
||||||
if get_option('introspection').allowed()
|
if get_option('introspection').enabled()
|
||||||
libmks_gir_extra_args = [
|
libmks_gir_extra_args = [
|
||||||
'--c-include=libmks.h',
|
'--c-include=libmks.h',
|
||||||
'--quiet',
|
'--quiet',
|
||||||
|
@ -164,7 +164,7 @@ if have_tests
|
|||||||
endif
|
endif
|
||||||
summary('Enabled', have_tests, section: 'Tests')
|
summary('Enabled', have_tests, section: 'Tests')
|
||||||
|
|
||||||
if get_option('docs') and get_option('introspection').allowed()
|
if get_option('docs') and get_option('introspection').enabled()
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
36
tests/functional.sh
Executable file
36
tests/functional.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
test -e 512-byte-vm.raw || wget https://github.com/oVirt/512-byte-vm/releases/download/2.0.0/512-byte-vm.raw
|
||||||
|
|
||||||
|
QEMU=""
|
||||||
|
|
||||||
|
ARCH="$(uname -m)"
|
||||||
|
test -x "/usr/bin/qemu-system-$ARCH" && QEMU="/usr/bin/qemu-system-$ARCH"
|
||||||
|
test -x /usr/libexec/qemu-kvm && QEMU=/usr/libexec/qemu-kvm
|
||||||
|
|
||||||
|
if [ -z "$QEMU" ]
|
||||||
|
then
|
||||||
|
echo "Missing QEMU executable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "Using $QEMU\n"
|
||||||
|
|
||||||
|
${QEMU} \
|
||||||
|
-drive file=512-byte-vm.raw,format=raw \
|
||||||
|
-display dbus -device virtio-vga \
|
||||||
|
-serial mon:stdio \
|
||||||
|
-enable-kvm &
|
||||||
|
|
||||||
|
QEMUPID=$!
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
BUILDDIR=${BUILDDIR:="builddir"}
|
||||||
|
"../${BUILDDIR}/tools/mks-connect"
|
||||||
|
"../${BUILDDIR}/tools/mks" &
|
||||||
|
MKSPID=$!
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
kill -SIGTERM $QEMUPID
|
||||||
|
kill -SIGTERM $MKSPID
|
Loading…
Reference in New Issue
Block a user