[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
This commit is contained in:
Martin Flöser 2019-01-06 16:34:10 +01:00
parent b1d753d7a6
commit 99df3c82f3
12 changed files with 56 additions and 24 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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);
}

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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());

View file

@ -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()