diff --git a/autotests/client/CMakeLists.txt b/autotests/client/CMakeLists.txt --- a/autotests/client/CMakeLists.txt +++ b/autotests/client/CMakeLists.txt @@ -341,7 +341,7 @@ # Test XdgShellV5 ######################################################## set( testXdgShellV5_SRCS - test_xdg_shell.cpp + test_xdg_shell_v5.cpp ) add_executable(testXdgShellV5 ${testXdgShellV5_SRCS}) target_link_libraries( testXdgShellV5 Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) diff --git a/autotests/client/test_xdg_shell.cpp b/autotests/client/test_xdg_shell.cpp --- a/autotests/client/test_xdg_shell.cpp +++ b/autotests/client/test_xdg_shell.cpp @@ -45,6 +45,9 @@ class XdgShellTest : public QObject { Q_OBJECT + +protected: + XdgShellTest(XdgShellInterfaceVersion version); private Q_SLOTS: void init(); void cleanup(); @@ -82,8 +85,15 @@ Output *m_output1 = nullptr; Output *m_output2 = nullptr; Seat *m_seat = nullptr; + + XdgShellInterfaceVersion m_version; }; + +XdgShellTest::XdgShellTest(XdgShellInterfaceVersion version): + m_version(version) +{} + static const QString s_socketName = QStringLiteral("kwayland-test-xdg_shell-0"); void XdgShellTest::init() @@ -107,8 +117,8 @@ m_seatInterface->create(); m_compositorInterface = m_display->createCompositor(m_display); m_compositorInterface->create(); - m_xdgShellInterface = m_display->createXdgShell(XdgShellInterfaceVersion::UnstableV5, m_display); - QCOMPARE(m_xdgShellInterface->interfaceVersion(), XdgShellInterfaceVersion::UnstableV5); + m_xdgShellInterface = m_display->createXdgShell(m_version, m_display); + QCOMPARE(m_xdgShellInterface->interfaceVersion(), m_version); m_xdgShellInterface->create(); // setup connection @@ -645,5 +655,4 @@ // TODO: test that this sends also the done to all parents } -QTEST_GUILESS_MAIN(XdgShellTest) #include "test_xdg_shell.moc" diff --git a/autotests/client/test_xdg_shell_v5.cpp b/autotests/client/test_xdg_shell_v5.cpp new file mode 100644 --- /dev/null +++ b/autotests/client/test_xdg_shell_v5.cpp @@ -0,0 +1,13 @@ +#include "test_xdg_shell.cpp" + +class XdgShellTestV5 : public XdgShellTest { + Q_OBJECT +public: + XdgShellTestV5() : + XdgShellTest(KWayland::Server::XdgShellInterfaceVersion::UnstableV5) {} +}; + +QTEST_GUILESS_MAIN(XdgShellTestV5) + +#include "test_xdg_shell_v5.moc" +