From c258422cf9962b994505030b7cc9bb00d22b7bf8 Mon Sep 17 00:00:00 2001 From: Tuomas Heimonen Date: Tue, 8 Sep 2015 14:52:21 +0300 Subject: tst_QProcess_and_GuiEventLoop: Added flag QT_NO_PROCESS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I895b9c12de8734c20ec87ac30a9a9cca8f4242d7 Reviewed-by: Pasi Petäjäjärvi Reviewed-by: Thiago Macieira --- .../qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/auto/other') diff --git a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp index 53459b13f6..b79b3aba28 100644 --- a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp +++ b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp @@ -45,9 +45,11 @@ private slots: void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) +#if defined(QT_NO_PROCESS) + QSKIP("QProcess not supported"); +#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) QSKIP("Not supported on Android"); -#endif +#else // based on testcase provided in QTBUG-39488 QByteArray msg = "Hello World"; @@ -78,6 +80,7 @@ void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop() QCOMPARE(process.exitCode(), 0); QCOMPARE(spy.count(), 1); QCOMPARE(process.readAll().trimmed(), msg); +#endif } QTEST_MAIN(tst_QProcess_and_GuiEventLoop) -- cgit v1.2.3 From b2e664df614dea23bf77c0fa293682b47a8b5557 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 24 Feb 2015 14:09:39 +0100 Subject: Enable tst_qaccessibilitylinux This test caused problems because it relies on the at-spi services to run. In addition it could trigger orca (screen reader) to be launched as a side-effect of the dbus call to the screen-reader-enabled setting. Instead just export QT_LINUX_ACCESSIBILITY_ALWAYS_ON to make sure that accessibility will work. This means we won't test the dbus startup any more, but the test will be reliable. There is still a dbus call to org.a11y.Bus to launch the service in case it's not running yet. Task-number: QTBUG-27732 Task-number: QTBUG-44434 Change-Id: Idb86ed98ca4b47cb209027c8b41529e7e5285197 Reviewed-by: Caroline Chao --- .../qaccessibilitylinux/qaccessibilitylinux.pro | 3 -- .../tst_qaccessibilitylinux.cpp | 34 ++++++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) (limited to 'tests/auto/other') diff --git a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro index 2ea54ab603..10d950541a 100644 --- a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro +++ b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro @@ -1,8 +1,5 @@ CONFIG += testcase -# This is temporary to start running the test as part of normal CI. -CONFIG += insignificant_test # QTBUG-27732 - include($$QT_SOURCE_TREE/src/platformsupport/accessibility/accessibility.pri) include($$QT_SOURCE_TREE/src/platformsupport/linuxaccessibility/linuxaccessibility.pri) diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp index 5f0eed5afe..4885a5f037 100644 --- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp +++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp @@ -84,7 +84,15 @@ class tst_QAccessibilityLinux : public QObject Q_OBJECT public: - tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0) {} + tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0) + { + qputenv("QT_LINUX_ACCESSIBILITY_ALWAYS_ON", QByteArrayLiteral("1")); + dbus = new DBusConnection(); + } + ~tst_QAccessibilityLinux() + { + delete dbus; + } private slots: void initTestCase(); @@ -112,7 +120,7 @@ private: QDBusInterface *rootApplication; QDBusInterface *mainWindow; - DBusConnection dbus; + DBusConnection *dbus; }; // helper to find children of a dbus object @@ -149,7 +157,7 @@ QString tst_QAccessibilityLinux::getParent(QDBusInterface *interface) // helper to get dbus object QDBusInterface *tst_QAccessibilityLinux::getInterface(const QString &path, const QString &interfaceName) { - return new QDBusInterface(address, path, interfaceName, dbus.connection(), this); + return new QDBusInterface(address, path, interfaceName, dbus->connection(), this); } void tst_QAccessibilityLinux::initTestCase() @@ -158,14 +166,22 @@ void tst_QAccessibilityLinux::initTestCase() qApp->setStyle("fusion"); qApp->setApplicationName("tst_QAccessibilityLinux app"); - // Pretend we are a screen reader + + // trigger launching of at-spi if it isn't running already QDBusConnection c = QDBusConnection::sessionBus(); OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(QStringLiteral("org.a11y.Bus"), QStringLiteral("/org/a11y/bus"), c, this); - a11yStatus->setScreenReaderEnabled(true); + // don't care about the result, calling any function on "org.a11y.Bus" will launch the service + a11yStatus->isEnabled(); + for (int i = 0; i < 5; ++i) { + if (!dbus->isEnabled()) + QTest::qWait(100); + } - QTRY_VERIFY(dbus.isEnabled()); - QTRY_VERIFY(dbus.connection().isConnected()); - address = dbus.connection().baseService().toLatin1().data(); + if (!dbus->isEnabled()) + QSKIP("Could not connect to AT-SPI, make sure lib atspi2 is installed."); + QTRY_VERIFY(dbus->isEnabled()); + QTRY_VERIFY(dbus->connection().isConnected()); + address = dbus->connection().baseService().toLatin1().data(); QVERIFY(!address.isEmpty()); m_window = new AccessibleTestWindow(); @@ -185,7 +201,7 @@ void tst_QAccessibilityLinux::cleanupTestCase() void tst_QAccessibilityLinux::registerDbus() { - QVERIFY(dbus.connection().isConnected()); + QVERIFY(dbus->connection().isConnected()); root = getInterface("/org/a11y/atspi/accessible/root", "org.a11y.atspi.Accessible"); -- cgit v1.2.3 From 9facf1be9b73da656557bab547aeb4148e6ff448 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Sep 2015 15:56:57 +0200 Subject: Tests: Always verify whether QTemporaryDir/File creation succeeded. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QVERIFY2() with QTemporaryDir/File::errorString() consistently. Attempt to catch issues like the below warning and follow-up issues. QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa" (Access is denied.) Task-number: QTBUG-47370 Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa Reviewed-by: Jędrzej Nowacki --- tests/auto/other/languagechange/tst_languagechange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/other') diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index 788993ef35..68d604547d 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -276,7 +276,7 @@ void tst_languageChange::retranslatability() tempDirPattern += QStringLiteral("languagechangetestdirXXXXXX"); QTemporaryDir temporaryDir(tempDirPattern); temporaryDir.setAutoRemove(true); - QVERIFY(temporaryDir.isValid()); + QVERIFY2(temporaryDir.isValid(), qPrintable(temporaryDir.errorString())); const QString finalDir = temporaryDir.path() + QStringLiteral("/finaldir"); const QString fooName = temporaryDir.path() + QStringLiteral("/foo"); QDir dir; -- cgit v1.2.3