tests: skip tst_QX11Info on Wayland

Pick-to: 6.3 6.2
Change-Id: I927ee28f61719ff1b67f73dc31dfcae9b73d8329
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Liang Qi 2022-02-16 16:25:11 +01:00
parent ae1197fc56
commit 760815599b
1 changed files with 10 additions and 0 deletions

View File

@ -112,6 +112,8 @@ void tst_QX11Info::startupId()
{
int argc = 0;
QGuiApplication app(argc, 0);
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("This test is only for X11, not Wayland.");
// This relies on the fact that no widget was shown yet,
// so please make sure this method is always the first test.
@ -133,6 +135,8 @@ void tst_QX11Info::isPlatformX11()
{
int argc = 0;
QGuiApplication app(argc, 0);
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("This test is only for X11, not Wayland.");
QVERIFY(QX11Info::isPlatformX11());
}
@ -141,6 +145,8 @@ void tst_QX11Info::appTime()
{
int argc = 0;
QGuiApplication app(argc, 0);
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("This test is only for X11, not Wayland.");
// No X11 event received yet
QCOMPARE(QX11Info::appTime(), 0ul);
@ -367,6 +373,8 @@ void tst_QX11Info::peeker()
{
int argc = 0;
QGuiApplication app(argc, 0);
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("This test is only for X11, not Wayland.");
PeekerTest test;
test.show();
@ -378,6 +386,8 @@ void tst_QX11Info::isCompositingManagerRunning()
{
int argc = 0;
QGuiApplication app(argc, 0);
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("This test is only for X11, not Wayland.");
const bool b = QX11Info::isCompositingManagerRunning();
Q_UNUSED(b);
const bool b2 = QX11Info::isCompositingManagerRunning(0);