[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: [Differential] [Request, 317 lines] D1726: Introduce a test server
From: graesslin_(Martin_Gräßlin) <noreply () phabricator ! kde ! or
Date: 2016-05-31 13:57:20
Message-ID: differential-rev-PHID-DREV-apaevo7gfudxf7h2oimo-req () phabricator ! kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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:
- Shm
- Compositor
- Shell
- Seat
- DataDeviceManager
- Idle
- SubCompositor
- Output (1280x1024 at 60 Hz with 96 dpi)
- FakeInput
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
[Attachment #5 (text/html)]
<div>graesslin created this revision.<br />
graesslin added a reviewer: Plasma.<br />
Restricted Application added a project: Plasma.<br />
Restricted Application added a subscriber: plasma-devel.</div><br \
/><div><strong>REVISION SUMMARY</strong><div><p>The idea of shipping a test server is \
to have something like Xvfb for<br /> Wayland. To be able to run a test application \
with a fake Wayland server.</p>
<p>To make this super easy the test server binary is installed into libexec<br />
directory and provides a cmake function to run a test application with<br />
the test server.</p>
<p>The test server takes full control over the process. It's a guiless<br />
application and starts the passed test application once it is fully<br />
set up. The environment is setup to have the test application connect<br />
to the fake server (WAYLAND_SOCKET env variable and QT_QPA_PLATFORM).</p>
<p>When the started application finishes the test server goes down and<br />
exits with the exit value of the test application. This allows a good<br />
integration with ctest.</p>
<p>The test server is a virtual server which supports the following<br />
interfaces:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Shm</li>
<li class="remarkup-list-item">Compositor</li>
<li class="remarkup-list-item">Shell</li>
<li class="remarkup-list-item">Seat</li>
<li class="remarkup-list-item">DataDeviceManager</li>
<li class="remarkup-list-item">Idle</li>
<li class="remarkup-list-item">SubCompositor</li>
<li class="remarkup-list-item">Output (1280x1024 at 60 Hz with 96 dpi)</li>
<li class="remarkup-list-item">FakeInput</li>
</ul>
<p>This is sufficient to bring up a QtWayland based application and<br />
allows some basic interactions from a test application (e.g. fake<br />
input).</p>
<p>So far the server fakes a repaint every 16 msec, but does not yet<br />
pass events to the test applications.</p>
<p>To integrate this into an application for testing use:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px \
"Menlo", "Consolas", "Monaco", monospace; padding: \
12px; margin: 0; background: rgba(71, 87, 120, 0.08);">find_package(KF5Wayland \
CONFIG) add_executable(myTest myTest.cpp)
target_link_libraries(myTest Qt5::Gui Qt5::Test)
kwaylandtest(myTest)</pre></div>
<p>When now running ctest in the build directory the test server gets<br />
started and will start the myTest binary and report the passed/failed<br />
in the expected and normal way.</p>
<p>This way a test case can easily be run against both X11 and \
Wayland.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKWAYLAND \
KWayland</div></div></div><br \
/><div><strong>BRANCH</strong><div><div>test-server</div></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D1726" \
rel="noreferrer">https://phabricator.kde.org/D1726</a></div></div><br \
/><div><strong>AFFECTED FILES</strong><div><div>KF5WaylandConfig.cmake.in<br /> \
src/tools/CMakeLists.txt<br /> src/tools/testserver/CMakeLists.txt<br />
src/tools/testserver/main.cpp<br />
src/tools/testserver/testserver.cpp<br />
src/tools/testserver/testserver.h</div></div></div><br /><div><strong>EMAIL \
PREFERENCES</strong><div><a \
href="https://phabricator.kde.org/settings/panel/emailpreferences/" \
rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br \
/><div><strong>To: </strong>graesslin, Plasma<br /><strong>Cc: </strong>plasma-devel, \
sebas<br /></div>
[Attachment #6 (text/plain)]
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic