Merge wayland tests with other tests

This makes wayland tests organization consistent with other kwin tests.
This commit is contained in:
Vlad Zahorodnii 2023-10-06 12:11:35 +03:00
parent d57c66872c
commit 7d56aa3687
62 changed files with 90 additions and 88 deletions

View file

@ -3,6 +3,7 @@ remove_definitions(-DQT_USE_QSTRINGBUILDER)
add_subdirectory(libkwineffects)
add_subdirectory(integration)
add_subdirectory(libinput)
add_subdirectory(wayland)
# drm autotests are broken on FreeBSD for yet unknown reasons
# As the test isn't doing anything platform specific, only run it on Linux
if(CMAKE_SYSTEM_NAME MATCHES "Linux")

View file

@ -3,7 +3,7 @@
########################################################
set( testWaylandOutput_SRCS
test_wayland_output.cpp
../../tests/fakeoutput.cpp
${PROJECT_SOURCE_DIR}/tests/fakeoutput.cpp
)
add_executable(testWaylandOutput ${testWaylandOutput_SRCS})
target_link_libraries( testWaylandOutput Qt::Test Qt::Gui KF6::WaylandClient kwin Wayland::Client Wayland::Server)
@ -15,7 +15,7 @@ ecm_mark_as_test(testWaylandOutput)
########################################################
set( testWaylandSurface_SRCS
test_wayland_surface.cpp
../../tests/fakeoutput.cpp
${PROJECT_SOURCE_DIR}/tests/fakeoutput.cpp
)
add_executable(testWaylandSurface ${testWaylandSurface_SRCS})
target_link_libraries( testWaylandSurface Qt::Test Qt::Gui KF6::WaylandClient kwin Wayland::Client Wayland::Server)
@ -217,7 +217,10 @@ ecm_mark_as_test(testXdgForeign)
########################################################
# Test XdgShell
########################################################
set(testXdgShell_SRCS test_xdg_shell.cpp ../../tests/fakeoutput.cpp)
set(testXdgShell_SRCS
test_xdg_shell.cpp
${PROJECT_SOURCE_DIR}/tests/fakeoutput.cpp
)
add_executable(testXdgShell ${testXdgShell_SRCS})
target_link_libraries( testXdgShell Qt::Test Qt::Gui kwin KF6::WaylandClient Wayland::Client)
add_test(NAME kwayland-testXdgShell COMMAND testXdgShell)
@ -294,7 +297,7 @@ ecm_mark_as_test(testPlasmaActivities)
########################################################
set( testXdgOutput_SRCS
test_xdg_output.cpp
../../tests/fakeoutput.cpp
${PROJECT_SOURCE_DIR}/tests/fakeoutput.cpp
)
add_executable(testXdgOutput ${testXdgOutput_SRCS})
target_link_libraries( testXdgOutput Qt::Test Qt::Gui KF6::WaylandClient kwin Wayland::Client Wayland::Server)

View file

@ -92,7 +92,11 @@ qt6_generate_wayland_protocol_client_sources(testInputMethodInterface
FILES
${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
)
target_sources(testInputMethodInterface PRIVATE test_inputmethod_interface.cpp ../../tests/fakeoutput.cpp ${INPUTMETHOD_SRCS})
target_sources(testInputMethodInterface PRIVATE
test_inputmethod_interface.cpp
${PROJECT_SOURCE_DIR}/tests/fakeoutput.cpp
${INPUTMETHOD_SRCS}
)
target_link_libraries(testInputMethodInterface Qt::Test kwin KF6::WaylandClient Wayland::Client)
add_test(NAME kwayland-testInputMethodInterface COMMAND testInputMethodInterface)
ecm_mark_as_test(testInputMethodInterface)

View file

@ -1,10 +1,5 @@
add_subdirectory(tools)
if (BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests)
endif()
# CMake has a known bug where target_source() doesn't work as expected with files generated
# in a directory other than the one where the target is defined. It should be fixed in 3.20.
add_library(WaylandProtocols_xml OBJECT)

View file

@ -1,65 +0,0 @@
include(ECMMarkAsTest)
# find_package(Qt6Core ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENT Private _check_private)
include_directories(SYSTEM ${Qt6Core_PRIVATE_INCLUDE_DIRS})
set(testServer_SRCS
waylandservertest.cpp
fakeoutput.cpp
)
add_executable(testServer ${testServer_SRCS})
target_link_libraries(testServer kwin Qt::CorePrivate)
ecm_mark_as_test(testServer)
find_package(Qt6Widgets ${QT_MIN_VERSION} CONFIG QUIET)
if (TARGET Qt::Widgets)
set(testRenderingServer_SRCS
renderingservertest.cpp
fakeoutput.cpp
)
add_executable(testRenderingServer ${testRenderingServer_SRCS})
target_link_libraries(testRenderingServer kwin Qt::Core Qt::Widgets)
ecm_mark_as_test(testRenderingServer)
endif()
add_executable(copyClient copyclient.cpp)
target_link_libraries(copyClient KF6::WaylandClient)
ecm_mark_as_test(copyClient)
add_executable(pasteClient pasteclient.cpp)
target_link_libraries(pasteClient Qt::Core KF6::WaylandClient)
ecm_mark_as_test(pasteClient)
add_executable(touchClientTest touchclienttest.cpp)
target_link_libraries(touchClientTest KF6::WaylandClient)
add_executable(panelTest paneltest.cpp)
target_link_libraries(panelTest KF6::WaylandClient)
ecm_mark_as_test(panelTest)
add_executable(subsurface-test subsurfacetest.cpp)
target_link_libraries(subsurface-test Qt::Core Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(subsurface-test)
add_executable(shadowTest shadowtest.cpp)
target_link_libraries(shadowTest KF6::WaylandClient)
ecm_mark_as_test(shadowTest)
if (TARGET Qt::Widgets)
add_executable(dpmsTest dpmstest.cpp)
target_link_libraries(dpmsTest KF6::WaylandClient Qt::Widgets)
ecm_mark_as_test(dpmsTest)
endif()
add_executable(plasmasurface-test plasmasurfacetest.cpp)
target_link_libraries(plasmasurface-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(plasmasurface-test)
add_executable(xdgforeign-test xdgforeigntest.cpp)
target_link_libraries(xdgforeign-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(xdgforeign-test)
add_executable(xdg-test xdgtest.cpp)
target_link_libraries(xdg-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(xdg-test)

View file

@ -25,3 +25,67 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(xdgactivationtest-qt6 xdgactivationtest-qt6.cpp)
target_link_libraries(xdgactivationtest-qt6 Qt6::Widgets)
include(ECMMarkAsTest)
# find_package(Qt6Core ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENT Private _check_private)
include_directories(SYSTEM ${Qt6Core_PRIVATE_INCLUDE_DIRS})
set(testServer_SRCS
waylandservertest.cpp
fakeoutput.cpp
)
add_executable(testServer ${testServer_SRCS})
target_link_libraries(testServer kwin Qt::CorePrivate)
ecm_mark_as_test(testServer)
find_package(Qt6Widgets ${QT_MIN_VERSION} CONFIG QUIET)
if (TARGET Qt::Widgets)
set(testRenderingServer_SRCS
renderingservertest.cpp
fakeoutput.cpp
)
add_executable(testRenderingServer ${testRenderingServer_SRCS})
target_link_libraries(testRenderingServer kwin Qt::Core Qt::Widgets)
ecm_mark_as_test(testRenderingServer)
endif()
add_executable(copyClient copyclient.cpp)
target_link_libraries(copyClient KF6::WaylandClient)
ecm_mark_as_test(copyClient)
add_executable(pasteClient pasteclient.cpp)
target_link_libraries(pasteClient Qt::Core KF6::WaylandClient)
ecm_mark_as_test(pasteClient)
add_executable(touchClientTest touchclienttest.cpp)
target_link_libraries(touchClientTest KF6::WaylandClient)
add_executable(panelTest paneltest.cpp)
target_link_libraries(panelTest KF6::WaylandClient)
ecm_mark_as_test(panelTest)
add_executable(subsurface-test subsurfacetest.cpp)
target_link_libraries(subsurface-test Qt::Core Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(subsurface-test)
add_executable(shadowTest shadowtest.cpp)
target_link_libraries(shadowTest KF6::WaylandClient)
ecm_mark_as_test(shadowTest)
if (TARGET Qt::Widgets)
add_executable(dpmsTest dpmstest.cpp)
target_link_libraries(dpmsTest KF6::WaylandClient Qt::Widgets)
ecm_mark_as_test(dpmsTest)
endif()
add_executable(plasmasurface-test plasmasurfacetest.cpp)
target_link_libraries(plasmasurface-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(plasmasurface-test)
add_executable(xdgforeign-test xdgforeigntest.cpp)
target_link_libraries(xdgforeign-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(xdgforeign-test)
add_executable(xdg-test xdgtest.cpp)
target_link_libraries(xdg-test Qt::Gui KF6::WaylandClient)
ecm_mark_as_test(xdg-test)

View file

@ -4,15 +4,15 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "../compositor.h"
#include "../datadevicemanager.h"
#include "../display.h"
#include "../keyboard.h"
#include "../output.h"
#include "../pointer.h"
#include "../seat.h"
#include "../xdgshell.h"
#include "core/graphicsbufferview.h"
#include "wayland/compositor.h"
#include "wayland/datadevicemanager.h"
#include "wayland/display.h"
#include "wayland/keyboard.h"
#include "wayland/output.h"
#include "wayland/pointer.h"
#include "wayland/seat.h"
#include "wayland/xdgshell.h"
#include "fakeoutput.h"

View file

@ -3,11 +3,11 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "../compositor.h"
#include "../display.h"
#include "../output.h"
#include "../seat.h"
#include "../xdgshell.h"
#include "wayland/compositor.h"
#include "wayland/display.h"
#include "wayland/output.h"
#include "wayland/seat.h"
#include "wayland/xdgshell.h"
#include "fakeoutput.h"