graesslin created this revision.
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION SUMMARY

The idea of shipping a test server is to have something like Xvfb for
Wayland. To be able to run a test application with a fake Wayland server.

To make this super easy the test server binary is installed into libexec
directory and provides a cmake function to run a test application with
the test server.

The test server takes full control over the process. It's a guiless
application and starts the passed test application once it is fully
set up. The environment is setup to have the test application connect
to the fake server (WAYLAND_SOCKET env variable and QT_QPA_PLATFORM).

When the started application finishes the test server goes down and
exits with the exit value of the test application. This allows a good
integration with ctest.

The test server is a virtual server which supports the following
interfaces:

This is sufficient to bring up a QtWayland based application and
allows some basic interactions from a test application (e.g. fake
input).

So far the server fakes a repaint every 16 msec, but does not yet
pass events to the test applications.

To integrate this into an application for testing use:

find_package(KF5Wayland CONFIG)
add_executable(myTest myTest.cpp)
target_link_libraries(myTest Qt5::Gui Qt5::Test)
kwaylandtest(myTest)

When now running ctest in the build directory the test server gets
started and will start the myTest binary and report the passed/failed
in the expected and normal way.

This way a test case can easily be run against both X11 and Wayland.


REPOSITORY
rKWAYLAND KWayland

BRANCH
test-server

REVISION DETAIL
https://phabricator.kde.org/D1726

AFFECTED FILES
KF5WaylandConfig.cmake.in
src/tools/CMakeLists.txt
src/tools/testserver/CMakeLists.txt
src/tools/testserver/main.cpp
src/tools/testserver/testserver.cpp
src/tools/testserver/testserver.h

EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/

To: graesslin, Plasma
Cc: plasma-devel, sebas