[plasma/kwin] autotests/integration: autotests: also run autotests if no render node is available
Xaver Hugl <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit d50a7368fd119e32e9cd9f1fcc96cfe2b6779d59 by Xaver Hugl.
Committed on 16/07/2026 at 19:21.
Pushed by zamundaaa into branch 'master'.
autotests: also run autotests if no render node is available
Since KWin can allocate buffers with udmabuf, we don't need drm nodes for
running the tests anymore.
M +0 -4 autotests/integration/dont_crash_aurorae_destroy_deco.cpp
M +0 -4 autotests/integration/dont_crash_empty_deco.cpp
M +0 -4 autotests/integration/dont_crash_reinitialize_compositor.cpp
M +0 -4 autotests/integration/effects/desktop_switching_animation_test.cpp
M +0 -4 autotests/integration/effects/maximize_animation_test.cpp
M +0 -4 autotests/integration/effects/minimize_animation_test.cpp
M +0 -4 autotests/integration/effects/scripted_effects_test.cpp
M +0 -4 autotests/integration/effects/slidingpopups_test.cpp
M +0 -4 autotests/integration/effects/toplevel_open_close_animation_test.cpp
M +0 -5 autotests/integration/fractional_repaint_test.cpp
M +0 -4 autotests/integration/generic_scene_opengl_test.cpp
M +0 -12 autotests/integration/kwin_wayland_test.h
M +0 -32 autotests/integration/test_helpers.cpp
https://invent.kde.org/plasma/kwin/-/commit/d50a7368fd119e32e9cd9f1fcc96cfe2b6779d59
diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp
index 86c9c771a64..eb1b349425c 100644
--- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp
+++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp
@@ -34,10 +34,6 @@ private Q_SLOTS:
void DontCrashAuroraeDestroyDecoTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qRegisterMetaType<KWin::Window *>();
QVERIFY(waylandServer()->init(qAppName()));
diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp
index 9e0d555a295..38963f6c354 100644
--- a/autotests/integration/dont_crash_empty_deco.cpp
+++ b/autotests/integration/dont_crash_empty_deco.cpp
@@ -32,10 +32,6 @@ private Q_SLOTS:
void DontCrashEmptyDecorationTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qRegisterMetaType<KWin::Window *>();
QVERIFY(waylandServer()->init(qAppName()));
diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp
index 921ffcf984e..070cb9e59db 100644
--- a/autotests/integration/dont_crash_reinitialize_compositor.cpp
+++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp
@@ -37,10 +37,6 @@ private Q_SLOTS:
void DontCrashReinitializeCompositorTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
diff --git a/autotests/integration/effects/desktop_switching_animation_test.cpp b/autotests/integration/effects/desktop_switching_animation_test.cpp
index daa9943336b..5a8a3e058dc 100644
--- a/autotests/integration/effects/desktop_switching_animation_test.cpp
+++ b/autotests/integration/effects/desktop_switching_animation_test.cpp
@@ -39,10 +39,6 @@ private Q_SLOTS:
void DesktopSwitchingAnimationTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp
index bf5b601b8ce..f292ee3e0d2 100644
--- a/autotests/integration/effects/maximize_animation_test.cpp
+++ b/autotests/integration/effects/maximize_animation_test.cpp
@@ -35,10 +35,6 @@ private Q_SLOTS:
void MaximizeAnimationTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
diff --git a/autotests/integration/effects/minimize_animation_test.cpp b/autotests/integration/effects/minimize_animation_test.cpp
index f7c3020303c..9f2bac1b02e 100644
--- a/autotests/integration/effects/minimize_animation_test.cpp
+++ b/autotests/integration/effects/minimize_animation_test.cpp
@@ -35,10 +35,6 @@ private Q_SLOTS:
void MinimizeAnimationTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp
index 9fbf1ba4e77..f017748f1d2 100644
--- a/autotests/integration/effects/scripted_effects_test.cpp
+++ b/autotests/integration/effects/scripted_effects_test.cpp
@@ -121,10 +121,6 @@ bool ScriptedEffectWithDebugSpy::load(const QString &name)
void ScriptedEffectsTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Effect *>();
QVERIFY(waylandServer()->init(qAppName()));
diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp
index ff21a35fc07..0b96a25fc73 100644
--- a/autotests/integration/effects/slidingpopups_test.cpp
+++ b/autotests/integration/effects/slidingpopups_test.cpp
@@ -35,10 +35,6 @@ private Q_SLOTS:
void SlidingPopupsTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Effect *>();
diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp
index 9951b8cf480..e0855c07989 100644
--- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp
+++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp
@@ -36,10 +36,6 @@ private Q_SLOTS:
void ToplevelOpenCloseAnimationTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
diff --git a/autotests/integration/fractional_repaint_test.cpp b/autotests/integration/fractional_repaint_test.cpp
index c857f4bc1a6..35f725cf377 100644
--- a/autotests/integration/fractional_repaint_test.cpp
+++ b/autotests/integration/fractional_repaint_test.cpp
@@ -29,11 +29,6 @@ private Q_SLOTS:
void FractionalRepaintTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
-
qRegisterMetaType<Window *>();
QVERIFY(waylandServer()->init(qAppName()));
diff --git a/autotests/integration/generic_scene_opengl_test.cpp b/autotests/integration/generic_scene_opengl_test.cpp
index e89a6568b0e..7c531aad890 100644
--- a/autotests/integration/generic_scene_opengl_test.cpp
+++ b/autotests/integration/generic_scene_opengl_test.cpp
@@ -33,10 +33,6 @@ void GenericSceneOpenGLTest::cleanup()
void GenericSceneOpenGLTest::initTestCase()
{
- if (!Test::renderNodeAvailable()) {
- QSKIP("no render node available");
- return;
- }
qRegisterMetaType<KWin::Window *>();
QVERIFY(waylandServer()->init(qAppName()));
diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h
index d210ef90392..ff2c5819ba7 100644
--- a/autotests/integration/kwin_wayland_test.h
+++ b/autotests/integration/kwin_wayland_test.h
@@ -1418,18 +1418,6 @@ bool lockScreen();
*/
bool unlockScreen();
-/**
- * Returns @c true if the system has at least one render node; otherwise returns @c false.
- *
- * This can be used to test whether the system is capable of allocating and sharing prime buffers, etc.
- */
-bool renderNodeAvailable();
-
-/**
- * Returns @c true if the system has at least one primary node; otherwise returns @c false.
- */
-bool primaryNodeAvailable();
-
/**
* Creates an X11 connection
* Internally a nested event loop is spawned whilst we connect to avoid a deadlock
diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp
index 80c9ce2f32f..aa2f050ad83 100644
--- a/autotests/integration/test_helpers.cpp
+++ b/autotests/integration/test_helpers.cpp
@@ -58,9 +58,7 @@
// system
#include <sys/socket.h>
-#include <sys/types.h>
#include <unistd.h>
-#include <xf86drm.h>
namespace KWin
{
@@ -1469,36 +1467,6 @@ bool unlockScreen()
}
#endif // KWIN_BUILD_LOCKSCREEN
-static bool haveDrmNode(int type)
-{
- const int deviceCount = drmGetDevices2(0, nullptr, 0);
- if (deviceCount <= 0) {
- return false;
- }
-
- QList<drmDevice *> devices(deviceCount);
- if (drmGetDevices2(0, devices.data(), devices.size()) < 0) {
- return false;
- }
- auto deviceCleanup = qScopeGuard([&devices]() {
- drmFreeDevices(devices.data(), devices.size());
- });
-
- return std::any_of(devices.constBegin(), devices.constEnd(), [type](drmDevice *device) {
- return device->available_nodes & (1 << type);
- });
-}
-
-bool renderNodeAvailable()
-{
- return haveDrmNode(DRM_NODE_RENDER);
-}
-
-bool primaryNodeAvailable()
-{
- return haveDrmNode(DRM_NODE_PRIMARY);
-}
-
#if KWIN_BUILD_X11
void XcbConnectionDeleter::operator()(xcb_connection_t *pointer)
{