From 1f0a31d6a6113e92f561fb9172580b5f35147450 Mon Sep 17 00:00:00 2001 From: Tero Heikkinen Date: Mon, 10 Jul 2023 14:14:56 +0000 Subject: [PATCH] Add QEXPECT_FAIL to tst_QApplication::sendEventsOnProcessEvents Test sendEventsOnProcessEvents has been noticed to fail when qgtk3 (Glib) is loaded - Should be fixed in QTBUG-87137 Moving test from blacklist to use QEXPECT_FAIL as it's more recommended until test is fixed in the relevant configurations. QEXPECT_FAIL is selected to use as original investigator reported also some cases when glib is working. Therefore this approach is giving us more insight for further investigation is it always failing with glib or not. It was also reported linkage to zeroTimer test QTBUG-84291, but not sure why removing that has affected to this one. Update to QEXPECT_FAIL documentation to tell in first place that XPASS is not only marking it as XPASS but also failing the test. Same is mentioned in different location but it needs more searching or testing how it works in real test. Task-number: QTBUG-115155 Change-Id: I7fb4ef28dba8adb7009be528f88fc758a12e9006 (cherry picked from commit de942651698d7dc6f2c2cabc1c0dc06b4e6b19fc) Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/testlib/qtestcase.qdoc | 3 ++- tests/auto/widgets/kernel/qapplication/BLACKLIST | 4 ---- .../kernel/qapplication/tst_qapplication.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 823214a8c43..9b539deb1e1 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -782,7 +782,8 @@ failure will be reported. If a \l QVERIFY() or \l QCOMPARE() is marked as an expected failure, - but passes instead, an unexpected pass (XPASS) is written to the test log. + but passes instead, an unexpected pass (XPASS) is written to the test log + and will be counted as a test failure. The parameter \a dataIndex describes for which entry in the test data the failure is expected. Pass an empty string (\c{""}) if the failure diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST index 7f4dd882616..c68c7d6b149 100644 --- a/tests/auto/widgets/kernel/qapplication/BLACKLIST +++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST @@ -1,7 +1,3 @@ -[sendEventsOnProcessEvents] -ubuntu-20.04 -ubuntu-22.04 -rhel-9.0 [touchEventPropagation] # QTBUG-66745 opensuse-leap diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 3ed9743838c..b72d4fef262 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -164,6 +164,20 @@ void tst_QApplication::sendEventsOnProcessEvents() QCoreApplication::postEvent(&app, new QEvent(QEvent::Type(QEvent::User + 1))); QCoreApplication::processEvents(); + +#ifdef Q_OS_LINUX + if ((QSysInfo::productType() == "rhel" && QSysInfo::productVersion().startsWith(u'9')) + || (QSysInfo::productType() == "ubuntu" && QSysInfo::productVersion().startsWith(u'2'))) + { + QFile f("/proc/self/maps"); + QVERIFY(f.open(QIODevice::ReadOnly)); + + QByteArray libs = f.readAll(); + if (libs.contains("libqgtk3.") || libs.contains("libqgtk3TestInfix.")) + QEXPECT_FAIL("", "Fails if qgtk3 (Glib) is loaded, see QTBUG-87137", Abort); + } +#endif + QVERIFY(spy.recordedEvents.contains(QEvent::User + 1)); }