libmks/README.md

54 lines
1.3 KiB
Markdown
Raw Normal View History

# libmks
2023-05-23 10:24:33 +00:00
This library provides a "Mouse, Keyboard, and Screen" to QEMU using the
D-Bus device support in QEMU and GTK 4.
2023-04-04 09:24:47 +00:00
# Documentation
2023-07-11 12:48:23 +00:00
Nightly documentation can be found [here](https://gnome.pages.gitlab.gnome.org/libmks/libmks1).
2023-04-04 09:24:47 +00:00
# Unit testing
Be sure you have `lcov` package installed on your system if you want coverage data.
```bash
meson setup builddir
meson configure -Db_coverage=true builddir # if you want to collect coverage data
meson compile -C builddir
meson test -C builddir --suit "libmks"
rm -rf builddir/subprojects # if you don't want subprojects coverage in the report
ninja coverage-html -C builddir # if you want to generate coverage report
```
If generated, coverage report will be in `builddir/meson-logs/coveragereport/index.html`
2023-02-17 17:12:42 +00:00
# Testing
2023-05-23 10:24:33 +00:00
By default, QEMU will connect to your user session D-Bus if you do not
2023-02-17 17:12:42 +00:00
provide an address for `-display dbus`. Therefore, it is pretty easy to
2023-05-23 10:24:33 +00:00
test things by running QEMU manually and then connecting with the test
2023-02-17 17:12:42 +00:00
program `./tools/mks`.
```sh
qemu-img create -f qcow2 fedora.img 30G
qemu-system-x86_64 \
-enable-kvm \
2023-03-29 11:11:41 +00:00
-cpu host \
2023-02-17 17:12:42 +00:00
-device virtio-vga-gl,xres=1920,yres=1080 \
-m 8G \
-smp 4 \
-display dbus,gl=on \
-cdrom Fedora-Workstation.iso \
-hda fedora.img \
-boot d
```
and then to run the test widget
```sh
meson setup build
cd build
ninja
./tools/mks
```