diff options
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication')
5 files changed, 62 insertions, 45 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST index ca0efdff8a..d7de7bf16e 100644 --- a/tests/auto/widgets/kernel/qapplication/BLACKLIST +++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST @@ -1,3 +1,4 @@ [touchEventPropagation] # QTBUG-66745 opensuse +opensuse-leap diff --git a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro index a10ff71b05..442bf33b61 100644 --- a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro +++ b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro @@ -1,6 +1,14 @@ QT += widgets -CONFIG -= app_bundle debug_and_release_target +CONFIG -= app_bundle -DESTDIR = ./ +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/desktopsettingsaware_helper + } else { + TARGET = ../../release/desktopsettingsaware_helper + } +} else { + TARGET = ../desktopsettingsaware_helper +} SOURCES += main.cpp diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro index a34871d2aa..e832d90821 100644 --- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro +++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro @@ -1,7 +1,15 @@ QT += widgets SOURCES += main.cpp \ base.cpp -DESTDIR = ./ -CONFIG -= app_bundle debug_and_release_target +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/modal_helper + } else { + TARGET = ../../release/modal_helper + } +} else { + TARGET = ../modal_helper +} +CONFIG -= app_bundle HEADERS += base.h diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro index 41aad02a1b..8ade4d8364 100644 --- a/tests/auto/widgets/kernel/qapplication/test/test.pro +++ b/tests/auto/widgets/kernel/qapplication/test/test.pro @@ -1,18 +1,28 @@ CONFIG += testcase -CONFIG -= debug_and_release_target QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += ../tst_qapplication.cpp -TARGET = ../tst_qapplication -TESTDATA = ../test/test.pro ../tmp/README +builtin_testdata: DEFINES += BUILTIN_TESTDATA -!android:!winrt { - SUBPROGRAMS = desktopsettingsaware modal - win32:SUBPROGRAMS += wincmdline +TESTDATA = ../test/test.pro ../tmp/README ../modal - for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}" -} +!android:!winrt: SUBPROGRAMS = desktopsettingsaware modal +debug_and_release { + CONFIG(debug, debug|release) { + TARGET = ../../debug/tst_qapplication + !android:!winrt: TEST_HELPER_INSTALLS = ../debug/helper + for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../debug/$${file}" + } else { + TARGET = ../../release/tst_qapplication + !android:!winrt: TEST_HELPER_INSTALLS = ../release/helper + for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../release/$${file}" + } +} else { + TARGET = ../tst_qapplication + !android:!winrt: TEST_HELPER_INSTALLS = ../helper + for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}" +} diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index bd4dc3d6f3..d2a244b762 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -96,7 +96,6 @@ public: tst_QApplication(); private slots: - void initTestCase(); void cleanup(); void sendEventsOnProcessEvents(); // this must be the first test void staticSetup(); @@ -187,13 +186,6 @@ public: } }; -void tst_QApplication::initTestCase() -{ - // chdir to our testdata path and execute helper apps relative to that. - const QString testdataDir = QFileInfo(QFINDTESTDATA("desktopsettingsaware")).absolutePath(); - QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir)); -} - void tst_QApplication::sendEventsOnProcessEvents() { int argc = 0; @@ -277,6 +269,9 @@ public: void tst_QApplication::alert() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support more than 1 native widget at the same time"); +#endif int argc = 0; QApplication app(argc, 0); app.alert(0, 0); @@ -820,6 +815,9 @@ public: void tst_QApplication::closeAllWindows() { +#ifdef Q_OS_WINRT + QSKIP("PromptOnCloseWidget does not work on WinRT - QTBUG-68297"); +#endif int argc = 0; QApplication app(argc, 0); @@ -888,7 +886,11 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r) #define QT_TST_QAPP_DEBUG void tst_QApplication::libraryPaths() { +#ifndef BUILTIN_TESTDATA const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath(); +#else + const QString testDir = QFileInfo(QFINDTESTDATA("test.pro")).absolutePath(); +#endif QVERIFY(!testDir.isEmpty()); { QApplication::setLibraryPaths(QStringList() << testDir); @@ -921,6 +923,9 @@ void tst_QApplication::libraryPaths() QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList(); expected.sort(); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort); +#endif QVERIFY2(isPathListIncluded(actual, expected), qPrintable("actual:\n - " + actual.join("\n - ") + "\nexpected:\n - " + expected.join("\n - "))); @@ -1040,6 +1045,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() << QDir(app.applicationDirPath()).canonicalPath() << QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath(); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort); +#endif QVERIFY2(isPathListIncluded(app.libraryPaths(), expected), qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") + "\nexpected:\n - " + expected.join("\n - "))); @@ -1434,20 +1442,10 @@ void tst_QApplication::testDeleteLaterProcessEvents() void tst_QApplication::desktopSettingsAware() { #if QT_CONFIG(process) - QString path; - { - // We need an application object for QFINDTESTDATA to work - // properly in all cases. - int argc = 0; - QCoreApplication app(argc, 0); - path = QFINDTESTDATA("desktopsettingsaware/"); - } - QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application"); - path += "desktopsettingsaware"; QProcess testProcess; - testProcess.start(path); + testProcess.start("desktopsettingsaware_helper"); QVERIFY2(testProcess.waitForStarted(), - qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); + qPrintable(QString::fromLatin1("Cannot start 'desktopsettingsaware_helper': %1").arg(testProcess.errorString()))); QVERIFY(testProcess.waitForFinished(10000)); QCOMPARE(int(testProcess.state()), int(QProcess::NotRunning)); QVERIFY(int(testProcess.error()) != int(QProcess::Crashed)); @@ -1744,6 +1742,9 @@ void tst_QApplication::focusMouseClick() QSpontaneKeyEvent::setSpontaneous(&ev); QVERIFY(ev.spontaneous()); qApp->notify(&w2, &ev); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort); +#endif QTRY_COMPARE(QApplication::focusWidget(), &w2); // now back to tab focus and click again (it already had focus) -> focus should stay @@ -2112,23 +2113,12 @@ void tst_QApplication::touchEventPropagation() void tst_QApplication::qtbug_12673() { - QString path; - { - // We need an application object for QFINDTESTDATA to work - // properly in all cases. - int argc = 0; - QCoreApplication app(argc, 0); - path = QFINDTESTDATA("modal/"); - } - QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application"); - path += "modal"; - #if QT_CONFIG(process) QProcess testProcess; QStringList arguments; - testProcess.start(path, arguments); + testProcess.start("modal_helper", arguments); QVERIFY2(testProcess.waitForStarted(), - qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); + qPrintable(QString::fromLatin1("Cannot start 'modal_helper': %1").arg(testProcess.errorString()))); QVERIFY(testProcess.waitForFinished(20000)); QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit); #else |