[autotest/integration] Introduce a Test helper library to have less code duplication
ClosedPublic

Authored by graesslin on Jun 30 2016, 3:03 PM.

Details

Summary

A new namespace KWin::Test is added which provides a few helper
functions. It makes it easy to setup a KWayland client connection with
the base set to be able to create a Surface and flags to create
additional interfaces. This replaces the KWayland connection dance in
init() methods. For cleanup() there is also a dedicated helper function.

In addition there are helper functions to:

  • render a surface
  • create a surface
  • create a shell surface
  • flush the wayland client connection
  • access to the created interfaces - for compatibility with existing code

The idea is to extend this Test library also for other common use cases
like creating an X11 connection and X11 windows, etc.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 4871.Jun 30 2016, 3:03 PM
graesslin retitled this revision from to [autotest/integration] Introduce a Test helper library to have less code duplication.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptJun 30 2016, 3:03 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 4879.Jul 1 2016, 5:39 AM

Changed the struts_test.cpp to make it more robust in cleanup. It now tracks all combinations of
Surface/ShellClient it created and destroys them in the test method again and waits for them getting
destroyed. That way we don't need the qWait workaround in destroyWaylandConnection.

graesslin updated this revision to Diff 4880.Jul 1 2016, 6:03 AM

Remove the possible freeze in StrutsTest::cleanup. The idea of the loop was to ensure that
no client is leaked into the next test method. This is now ensured in init after all the
setup roundtrips. So likelihood of that to pass increases

bshah accepted this revision.Jul 1 2016, 6:22 AM
bshah added a reviewer: bshah.
This revision is now accepted and ready to land.Jul 1 2016, 6:22 AM
This revision was automatically updated to reflect the committed changes.