kwin/autotests/wayland/CMakeLists.txt

150 lines
6.8 KiB
Text
Raw Normal View History

add_definitions(-DKWINBACKENDPATH="${CMAKE_BINARY_DIR}/plugins/platforms/virtual/KWinWaylandVirtualBackend.so")
[autotest] Welcome to integration testing KWin This is the beginning of a new testing era for KWin: finally we are able to test against a running KWin. This works by making use of the new virtual framebuffer backend for Wayland. It starts a specific Application subclass which is mostly a fork of ApplicationWayland. The individual tests are able to influence the socket name and the size of the virtual screen. This is supposed to be done in initTestCase. To know when KWin is fully started one can use the workspaceCreated signal of KWin::Application. KWin is not started in another process, but the kwin library is used, so the test has pretty much full introspection to everything going on inside KWin. It can access the Workspace, WaylandServer, fake input events through InputRedirection and so on. Once the test KWin is running it's possible to connect to it using KWayland::Client library. This allows to introspect the Workspace to see whether all worked as expected (e.g. correct stacking order, active window and so on). This first autotest is mostly meant to illustrate how to setup a test and how one can use KWayland::Client to interact with the mock KWin. For more tests it is suggested to move the connections to the Wayland server in the init() and cleanup() methods. The change also affects the qpa plugin: the specific check to only run in binaries called kwin_wayland doesn't hold any more. This can now be overwritten by an env variable. Please note that this first test will probably fail in the CI system as it might not have XWayland which is needed by KWin.
2015-10-02 13:04:57 +00:00
add_definitions(-DKWINQPAPATH="${CMAKE_BINARY_DIR}/plugins/qpa/")
########################################################
# Test Start
########################################################
set( testStart_SRCS start_test.cpp kwin_wayland_test.cpp )
add_executable(testStart ${testStart_SRCS})
target_link_libraries( testStart kwin Qt5::Test)
add_test(kwin-testStart testStart)
ecm_mark_as_test(testStart)
########################################################
# Transient Window without input test
########################################################
set( testTransientNoInput_SRCS transient_no_input_test.cpp kwin_wayland_test.cpp )
add_executable(testTransientNoInput ${testTransientNoInput_SRCS})
target_link_libraries( testTransientNoInput kwin Qt5::Test)
add_test(kwin-testTransientNoInput testTransientNoInput)
ecm_mark_as_test(testTransientNoInput)
########################################################
# Quick Tiling test
########################################################
set( testQuickTiling_SRCS quick_tiling_test.cpp kwin_wayland_test.cpp )
add_executable(testQuickTiling ${testQuickTiling_SRCS})
target_link_libraries( testQuickTiling kwin Qt5::Test)
add_test(kwin-testQuickTiling testQuickTiling)
ecm_mark_as_test(testQuickTiling)
########################################################
# Move/Resize window test
########################################################
if (XCB_ICCCM_FOUND)
set( testMoveResize_SRCS move_resize_window_test.cpp kwin_wayland_test.cpp )
add_executable(testMoveResize ${testMoveResize_SRCS})
target_link_libraries( testMoveResize kwin Qt5::Test XCB::ICCCM)
add_test(kwin-testMoveResize testMoveResize)
ecm_mark_as_test(testMoveResize)
endif()
########################################################
# Don't Crash For glxgears
########################################################
set( testDontCrashGlxgears_SRCS dont_crash_glxgears.cpp kwin_wayland_test.cpp )
add_executable(testDontCrashGlxgears ${testDontCrashGlxgears_SRCS})
target_link_libraries( testDontCrashGlxgears kwin Qt5::Test)
add_test(kwin-testDontCrashGlxgears testDontCrashGlxgears)
ecm_mark_as_test(testDontCrashGlxgears)
########################################################
# Lock screen integration test
########################################################
set( testLockScreen_SRCS lockscreen.cpp kwin_wayland_test.cpp )
add_executable(testLockScreen ${testLockScreen_SRCS})
target_link_libraries( testLockScreen kwin Qt5::Test)
add_test(kwin-testLockScreen testLockScreen)
ecm_mark_as_test(testLockScreen)
########################################################
# Decoration input test
########################################################
set( testDecorationInput_SRCS decoration_input_test.cpp kwin_wayland_test.cpp )
add_executable(testDecorationInput ${testDecorationInput_SRCS})
target_link_libraries( testDecorationInput kwin Qt5::Test)
add_test(kwin-testDecorationInput testDecorationInput)
ecm_mark_as_test(testDecorationInput)
########################################################
# Internal Window test
########################################################
set( testInternalWindow_SRCS internal_window.cpp kwin_wayland_test.cpp )
add_executable(testInternalWindow ${testInternalWindow_SRCS})
target_link_libraries( testInternalWindow kwin Qt5::Test)
add_test(kwin-testInternalWindow testInternalWindow)
ecm_mark_as_test(testInternalWindow)
########################################################
# Touch Input Test
########################################################
set( testTouchInput_SRCS touch_input_test.cpp kwin_wayland_test.cpp )
add_executable(testTouchInput ${testTouchInput_SRCS})
target_link_libraries( testTouchInput kwin Qt5::Test)
add_test(kwin-testTouchInput testTouchInput)
ecm_mark_as_test(testTouchInput)
########################################################
# Input Stacking Order Test
########################################################
set( testInputStackingOrder_SRCS input_stacking_order.cpp kwin_wayland_test.cpp )
add_executable(testInputStackingOrder ${testInputStackingOrder_SRCS})
target_link_libraries( testInputStackingOrder kwin Qt5::Test)
add_test(kwin-testInputStackingOrder testInputStackingOrder)
ecm_mark_as_test(testInputStackingOrder)
########################################################
# Pointer Input Test
########################################################
set( testPointerInput_SRCS pointer_input.cpp kwin_wayland_test.cpp )
add_executable(testPointerInput ${testPointerInput_SRCS})
target_link_libraries( testPointerInput kwin Qt5::Test)
add_test(kwin-testPointerInput testPointerInput)
ecm_mark_as_test(testPointerInput)
########################################################
# PlatformCursorTest
########################################################
set( testPlatformCursor_SRCS platformcursor.cpp kwin_wayland_test.cpp )
add_executable(testPlatformCursor ${testPlatformCursor_SRCS})
target_link_libraries( testPlatformCursor kwin Qt5::Test)
add_test(kwin-testPlatformCursor testPlatformCursor)
ecm_mark_as_test(testPlatformCursor)
########################################################
# Don't crash cancel animation test
########################################################
set( testDontCrashCancelAnimation_SRCS dont_crash_cancel_animation.cpp kwin_wayland_test.cpp )
add_executable(testDontCrashCancelAnimation ${testDontCrashCancelAnimation_SRCS})
target_link_libraries( testDontCrashCancelAnimation kwin Qt5::Test)
add_test(kwin-testDontCrashCancelAnimation testDontCrashCancelAnimation)
ecm_mark_as_test(testDontCrashCancelAnimation)
########################################################
# Transient Placement Test
########################################################
set( testTransientPlacmenet_SRCS transient_placement.cpp kwin_wayland_test.cpp )
add_executable(testTransientPlacmenet ${testTransientPlacmenet_SRCS})
target_link_libraries( testTransientPlacmenet kwin Qt5::Test)
add_test(kwin-testTransientPlacmenet testTransientPlacmenet)
ecm_mark_as_test(testTransientPlacmenet)
Add a debugging console to KWin Summary: The idea behind the debugging console is to have a feature comparable to xprop and xwininfo just for Wayland. We cannot have command line utils as that violates the security restrictions, thus it needs to be exposed directly in KWin. The debugging console is invoked through DBus: qdbus org.kde.KWin /KWin showDebugConsole This opens a window with a tree view. The DebugConsoleModel which is used by the tree view groups all windows into four categories: * x11 clients (that is Workspace::clientList() and Workspace::desktopList()) * x11 unmanaged (Workspace::unmanagedList()) * wayland shell clients (WaylandServer::clients()) * wayland internal clients (KWin's own QWindows - WaylandServer::internalClients()) Each window is a child to one of the four categories. Each window itself has all it's QProperties exposed as children. This allows to properly inspect KWin's internal knowledge for windows and should make it easier to investigate problems. E.g. what's a window's geometry, what's it's window type and so on. The debugging console is intended as a developer tool and not expected to be used by users. That's why it's invokation is rather hidden. Due to the fact that it's internal to KWin it results in: * no window decoration * stealing keyboard focus * no way to resize, close, move from KWin side * rendered above all other windows There is a dedicated close button to get rid of it again. While the console is shown it's hardly possible to interact with the system in a normal way anymore. This is something which might be improved in future. At the moment the model is able to update when windows are added/removed, but not yet when a property changes. Due to the lack of interaction with the existing system, that's not a high priority at the moment, but can be added in future. Reviewers: #plasma Differential Revision: https://phabricator.kde.org/D1146
2016-03-14 09:23:52 +00:00
########################################################
# Debug Console Test
########################################################
set( testDebugConsole_SRCS debug_console_test.cpp kwin_wayland_test.cpp )
add_executable(testDebugConsole ${testDebugConsole_SRCS})
target_link_libraries( testDebugConsole kwin Qt5::Test)
add_test(kwin-testDebugConsole testDebugConsole)
ecm_mark_as_test(testDebugConsole)
########################################################
# Struts Test
########################################################
if (XCB_ICCCM_FOUND)
set( testStruts_SRCS struts_test.cpp kwin_wayland_test.cpp )
add_executable(testStruts ${testStruts_SRCS})
target_link_libraries( testStruts kwin Qt5::Test XCB::ICCCM)
add_test(kwin-testStruts testStruts)
ecm_mark_as_test(testStruts)
endif()