Commit 99df3c82 authored by Martin Flöser's avatar Martin Flöser

[autotests] Don't check whether there is a /dev/dri/card0

Summary:
With EGL_MESA_platform_surfaceless we don't need a dri device anymore.
So we don't need to skip the tests if the device is missing. Instead the
tests verify that OpenGL compositing is used if requested.

Test Plan: ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18014
parent b1d753d7
......@@ -20,11 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "platform.h"
#include "client.h"
#include "composite.h"
#include "cursor.h"
#include "screenedge.h"
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "scene.h"
#include "shell_client.h"
#include <kwineffects.h>
......@@ -51,9 +53,6 @@ private Q_SLOTS:
void DontCrashAuroraeDestroyDecoTest::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
......@@ -77,6 +76,10 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase()
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
setenv("QT_QPA_PLATFORM", "wayland", true);
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void DontCrashAuroraeDestroyDecoTest::init()
......
......@@ -20,7 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "platform.h"
#include "client.h"
#include "composite.h"
#include "cursor.h"
#include "scene.h"
#include "screenedge.h"
#include "screens.h"
#include "wayland_server.h"
......@@ -48,9 +50,6 @@ private Q_SLOTS:
void DontCrashEmptyDecorationTest::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -68,6 +67,10 @@ void DontCrashEmptyDecorationTest::initTestCase()
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
setenv("QT_QPA_PLATFORM", "wayland", true);
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void DontCrashEmptyDecorationTest::init()
......
......@@ -21,7 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "platform.h"
#include "client.h"
#include "composite.h"
#include "cursor.h"
#include "scene.h"
#include "screenedge.h"
#include "screens.h"
#include "wayland_server.h"
......@@ -55,9 +57,6 @@ private Q_SLOTS:
void DontCrashNoBorder::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -80,6 +79,10 @@ void DontCrashNoBorder::initTestCase()
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
setenv("QT_QPA_PLATFORM", "wayland", true);
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void DontCrashNoBorder::init()
......
......@@ -86,6 +86,10 @@ void DontCrashReinitializeCompositorTest::initTestCase()
QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024));
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void DontCrashReinitializeCompositorTest::init()
......
......@@ -170,6 +170,10 @@ void ScriptedEffectsTest::initTestCase()
QVERIFY(workspaceCreatedSpy.wait());
QVERIFY(Compositor::self());
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
KWin::VirtualDesktopManager::self()->setCount(2);
}
......
......@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effectloader.h"
#include "cursor.h"
#include "platform.h"
#include "scene.h"
#include "shell_client.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -86,13 +87,15 @@ void SlidingPopupsTest::initTestCase()
config->sync();
kwinApp()->setConfig(config);
if (QFile::exists(QStringLiteral("/dev/dri/card0"))) {
qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2"));
}
qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2"));
qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1");
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
QVERIFY(Compositor::self());
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void SlidingPopupsTest::init()
......
......@@ -21,10 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "abstract_client.h"
#include "composite.h"
#include "deleted.h"
#include "effectloader.h"
#include "effects.h"
#include "platform.h"
#include "scene.h"
#include "shell_client.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -81,6 +83,10 @@ void ToplevelOpenCloseAnimationTest::initTestCase()
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void ToplevelOpenCloseAnimationTest::init()
......
......@@ -82,6 +82,10 @@ void WobblyWindowsShadeTest::initTestCase()
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
QVERIFY(Compositor::self());
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void WobblyWindowsShadeTest::init()
......
......@@ -49,9 +49,6 @@ void GenericSceneOpenGLTest::cleanup()
void GenericSceneOpenGLTest::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -78,6 +75,10 @@ void GenericSceneOpenGLTest::initTestCase()
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
QVERIFY(Compositor::self());
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void GenericSceneOpenGLTest::testRestart_data()
......
......@@ -20,7 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "platform.h"
#include "abstract_client.h"
#include "composite.h"
#include "cursor.h"
#include "scene.h"
#include "screenedge.h"
#include "screens.h"
#include "wayland_server.h"
......@@ -182,9 +184,6 @@ AbstractClient *LockScreenTest::showWindow()
void LockScreenTest::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -201,6 +200,10 @@ void LockScreenTest::initTestCase()
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
setenv("QT_QPA_PLATFORM", "wayland", true);
waylandServer()->initWorkspace();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void LockScreenTest::init()
......
......@@ -302,9 +302,6 @@ void PlasmaWindowTest::testPopupWindowNoPlasmaWindow()
void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
// this test verifies that lock screen windows are not exposed to PlasmaWindow
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
......
......@@ -113,9 +113,6 @@ void SceneOpenGLShadowTest::initTestCase()
{
// Copied from generic_scene_opengl_test.cpp
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -154,6 +151,10 @@ void SceneOpenGLShadowTest::initTestCase()
group.sync();
Workspace::self()->slotReconfigure();
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing);
}
void SceneOpenGLShadowTest::cleanup()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment