Tests: Remove Q_WS_QPA, qpa-sections from .profiles.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Tue, 25 Oct 2011 09:28:47 +0000 (11:28 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 27 Oct 2011 07:50:30 +0000 (09:50 +0200)
Compile without -qpa.

- Make Q_WS_QPA-#ifdefed sections the default in the code
- Replace some Q_WS_ by Q_OS_
- Add ### fixme for places that need checking
- Remove qpa conditionals from .pro files.

Change-Id: I6ea930afc0c236cc12a7b7e95f1b8a1c24b3a513
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
24 files changed:
tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
tests/auto/gui/painting/qprinter/tst_qprinter.cpp
tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
tests/auto/gui/text/qfont/tst_qfont.cpp
tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
tests/auto/integrationtests/integrationtests.pro
tests/auto/integrationtests/macplist/app/app.pro
tests/auto/integrationtests/macplist/app/main.cpp
tests/auto/qwindowsurface/tst_qwindowsurface.cpp
tests/auto/widgets/dialogs/qfontdialog/qfontdialog.pro
tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro
tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro
tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
tests/auto/widgets/kernel/qaction/tst_qaction.cpp
tests/auto/widgets/kernel/qsound/qsound.pro
tests/auto/widgets/kernel/qsound/tst_qsound.cpp
tests/auto/widgets/kernel/qwidget/qwidget.pro
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
tests/auto/widgets/widgets/qtextedit/qtextedit.pro

index 5ff7643..98b8570 100644 (file)
@@ -52,6 +52,7 @@
 #include <qsplashscreen.h>
 
 #include <qplatformpixmap_qpa.h>
+#include <private/qguiapplication_p.h>
 #include <private/qdrawhelper_p.h>
 
 #include <QSet>
@@ -774,9 +775,8 @@ void tst_QPixmap::grabWidget()
 
 void tst_QPixmap::grabWindow()
 {
-#ifdef Q_WS_QPA
+//  ### fixme: Check platforms
     QSKIP("QTBUG-20863 grabWindow is broken on most qpa backends");
-#endif
 #ifdef Q_OS_WINCE
     // We get out of memory, if the desktop itself is too big.
     if (QApplication::desktop()->width() <= 480)
@@ -1083,10 +1083,6 @@ void tst_QPixmap::fromWinHICON()
 
 void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
 {
-#ifdef Q_WS_QPA
-    QSKIP("QTBUG-20864 can't determine if threaded pixmaps are available for qpa");
-#endif
-#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
     class Thread : public QThread
     {
     public:
@@ -1108,10 +1104,12 @@ void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
             QVERIFY(pixmap2.isNull());
         }
     };
+    if (QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ThreadedPixmaps))
+        QSKIP("This platform supports threaded pixmaps.");
+
     Thread thread;
     thread.start();
     thread.wait();
-#endif // !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
 }
 
 void tst_QPixmap::refUnref()
index bdcfb00..4f6c7de 100644 (file)
@@ -55,7 +55,7 @@ class tst_QClipboard : public QObject
 {
     Q_OBJECT
 private slots:
-#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS)
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC)) && !defined(QT_NO_PROCESS)
     void copy_exit_paste();
 #endif
     void capabiliyFunctions();
@@ -191,14 +191,14 @@ void tst_QClipboard::testSignals()
 // This test does not make sense on X11 and embedded, as copied data disappears
 // from the clipboard when the application exits.  It's still possible to test
 // copy/paste - just keep the apps running.
-#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS)
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC)) && !defined(QT_NO_PROCESS)
 void tst_QClipboard::copy_exit_paste()
 {
     if (!nativeClipboardWorking())
         QSKIP("Native clipboard not working in this setup");
     const QStringList stringArgument = QStringList() << "Test string.";
     QCOMPARE(QProcess::execute("copier/copier", stringArgument), 0);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // The Pasteboard needs a moment to breathe (at least on older Macs).
     QTest::qWait(100);
 #endif
index 4352464..995f4ab 100644 (file)
@@ -82,9 +82,9 @@ private slots:
     void testSetOptions();
     void testMargins_data();
     void testMargins();
-#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(Q_OS_MAC)
+#ifdef Q_OS_WIN
     void testNonExistentPrinter();
-#endif
+#endif // Q_OS_WIN
     void testPageSetupDialog();
     void testMulitpleSets_data();
     void testMulitpleSets();
@@ -384,8 +384,7 @@ void tst_QPrinter::testMargins()
         delete painter;
 }
 
-// QPrinter::testNonExistentPrinter() is not relevant for some platforms.
-#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(Q_OS_MAC)
+#ifdef Q_OS_WIN
 void tst_QPrinter::testNonExistentPrinter()
 {
     QPrinter printer;
@@ -416,7 +415,7 @@ void tst_QPrinter::testNonExistentPrinter()
 
     QVERIFY(!painter.begin(&printer));
 }
-#endif
+#endif // Q_OS_WIN
 
 void tst_QPrinter::testMulitpleSets_data()
 {
index 822b527..1166c01 100644 (file)
@@ -1593,12 +1593,10 @@ void tst_QCssParser::extractFontFamily()
     extractor.extractFont(&fnt, &adjustment);
     QFontInfo info(fnt);
 
-#ifdef Q_WS_QPA
     // Note, we have to QSKIP rather than QEXPECT_FAIL because font lookup is broken
     // such that it may work or not work depending on the order in which fonts were
-    // loaded from disk
+    // loaded from disk: ### fixme: Check platforms
     QSKIP("QTBUG-20986 may fail on qpa");
-#endif
 
     QTEST(info.family(), "expectedFamily");
 }
index 3566342..a949c91 100644 (file)
@@ -80,9 +80,7 @@ private slots:
     void italicOblique();
     void insertAndRemoveSubstitutions();
     void serializeSpacing();
-#if !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
     void lastResortFont();
-#endif
 #if defined(Q_WS_MAC)
     void styleName();
 #endif
@@ -611,13 +609,13 @@ void tst_QFont::serializeSpacing()
 // QFont::lastResortFont() may abort with qFatal() on QWS/QPA
 // if absolutely no font is found. Just as ducumented for QFont::lastResortFont().
 // This happens on our CI machines which run QWS autotests.
-#if !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
+// ### fixme: Check platforms
 void tst_QFont::lastResortFont()
 {
+    QSKIP("QFont::lastResortFont() may abort with qFatal() on QPA, QTBUG-22325");
     QFont font;
     QVERIFY(!font.lastResortFont().isEmpty());
 }
-#endif
 
 #if defined(Q_WS_MAC)
 void tst_QFont::styleName()
index 4bd5000..0585444 100644 (file)
@@ -388,18 +388,7 @@ bool tst_QStaticText::supportsTransformations() const
 {
     QPixmap pm(10, 10);
     QPainter p(&pm);
-    QPaintEngine *engine = p.paintEngine();
-
-    QPaintEngine::Type type = engine->type();
-
-    if (type == QPaintEngine::OpenGL
-#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) && !defined(Q_WS_MAC) && !defined(Q_WS_QPA)
-        || type == QPaintEngine::Raster
-#endif
-        )
-        return false;
-
-    return true;
+    return p.paintEngine()->type() != QPaintEngine::OpenGL;
 }
 
 void tst_QStaticText::rotatedPainter()
index 1d58f2c..33d54e2 100644 (file)
@@ -22,10 +22,10 @@ SUBDIRS=\
 
 wince*|!contains(QT_CONFIG, accessibility):SUBDIRS -= qaccessibility
 
-!mac|qpa: SUBDIRS -= \
+!mac: SUBDIRS -= \
            macgui \
            macnativeevents \
-           macplist \
+           macplist
 
 !embedded|wince*: SUBDIRS -= \
            qdirectpainter \
index ddc47a9..90bf60a 100644 (file)
@@ -40,7 +40,7 @@
 ****************************************************************************/
 
 
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
 
 int main(int argc, char **argv)
 {
index e31d1d3..d7e716b 100644 (file)
@@ -125,9 +125,6 @@ static void VERIFY_COLOR(const QRegion &region, const QColor &color)
             const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(),
                                                    rect.left(), rect.top(),
                                                    rect.width(), rect.height());
-#ifdef Q_WS_QPA
-            QEXPECT_FAIL("", "QTBUG-20863 QPixmap::grabWindow unimplemented for qpa", Abort);
-#endif
             QCOMPARE(pixmap.size(), rect.size());
             QPixmap expectedPixmap(pixmap); /* ensure equal formats */
             expectedPixmap.fill(color);
index 9203b17..ff7fbb0 100644 (file)
@@ -6,8 +6,9 @@ QT += core-private gui-private
 
 SOURCES  += tst_qfontdialog.cpp
 
-mac:!qpa {
-    OBJECTIVE_SOURCES += tst_qfontdialog_mac_helpers.mm
-    LIBS += -framework Cocoa
+mac {
+#    ### fixme
+#    OBJECTIVE_SOURCES += tst_qfontdialog_mac_helpers.mm
+#    LIBS += -framework Cocoa
 }
 
index afdf133..b32c638 100644 (file)
@@ -4,4 +4,5 @@ TARGET = tst_qgraphicsgridlayout
 QT += widgets testlib
 SOURCES  += tst_qgraphicsgridlayout.cpp
 CONFIG += parallel_test
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+# ### fixme: QTBUG-20756 crashes on xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
index 4cda600..0d4b046 100644 (file)
@@ -7,4 +7,5 @@ DEFINES += QT_NO_CAST_TO_ASCII
 
 win32:!wince*: LIBS += -lUser32
 
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+# ### fixme: QTBUG-20756 crashes on xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
index 2dcaf70..50f4f7a 100644 (file)
@@ -6,4 +6,5 @@ QT += core-private gui-private
 
 SOURCES  += tst_qgraphicsproxywidget.cpp
 
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+# ### fixme: QTBUG-20756 crashes on xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
index 6c1a3f5..b45cdc7 100644 (file)
@@ -18,4 +18,5 @@ wince* {
    DEFINES += SRCDIR=\\\".\\\"
 }
 
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+# ### fixme: QTBUG-20756 crashes on xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
index 2aa782f..f78bd4f 100644 (file)
@@ -7,4 +7,5 @@ QT += core-private gui-private
 SOURCES  += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp
 DEFINES += QT_NO_CAST_TO_ASCII
 
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+# ### fixme: QTBUG-20756 crashes on xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
index 637ec14..560713a 100644 (file)
@@ -240,13 +240,12 @@ void tst_QAction::setStandardKeys()
     QVERIFY(act.shortcut() == act.shortcuts().first());
 
     QList<QKeySequence> expected;
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     expected  << QKeySequence("CTRL+C");
-#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
-    expected  << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT");
 #else
-    expected  << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT");
+    expected  << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT");
 #endif
+//  Qt/Embedded on Windows: expected  << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT");
     QVERIFY(act.shortcuts() == expected);
 }
 
index 4142afc..8317283 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG += testcase
 TARGET = tst_qsound
 SOURCES += tst_qsound.cpp
-QT += testlib
+QT += testlib widgets
 
 wince* {
     deploy.files += 4.wav
index 1b8907b..5f1e5fb 100644 (file)
@@ -41,7 +41,7 @@
 
 
 #include <QtTest/QtTest>
-#include <QtGui>
+#include <QtWidgets>
 
 class tst_QSound : public QObject
 {
@@ -59,9 +59,7 @@ private slots:
 
 void tst_QSound::checkFinished()
 {
-#if defined(Q_WS_QPA)
     QSKIP("QSound is not implemented on Lighthouse");
-#else
     QSound sound(SRCDIR"4.wav");
     sound.setLoops(3);
     sound.play();
@@ -71,17 +69,14 @@ void tst_QSound::checkFinished()
     QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
 #endif
     QVERIFY(sound.isFinished() );
-#endif
 }
 
 void tst_QSound::staticPlay()
 {
     QSKIP("Test disabled -- only for manual purposes");
-#if !defined(Q_WS_QPA)
     // Check that you hear sound with static play also.
     QSound::play(SRCDIR"4.wav");
     QTest::qWait(2000);
-#endif
 }
 
 QTEST_MAIN(tst_QSound);
index e6ec3b9..33b95d7 100644 (file)
@@ -10,9 +10,10 @@ aix-g++*:QMAKE_CXXFLAGS+=-fpermissive
 
 CONFIG += x11inc
 
-mac:!qpa {
-    LIBS += -framework Security -framework AppKit -framework Carbon
-    OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
+mac {
+# ### fixme
+# LIBS += -framework Security -framework AppKit -framework Carbon
+# OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
 }
 
 x11 {
index e92389f..c508c15 100644 (file)
@@ -380,7 +380,7 @@ private slots:
 
     void setClearAndResizeMask();
     void maskedUpdate();
-#if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
+#if !defined(Q_OS_WINCE_WM)
     void syntheticEnterLeave();
     void taskQTBUG_4055_sendSyntheticEnterLeave();
 #endif
@@ -1931,8 +1931,9 @@ void tst_QWidget::showMaximized()
     layouted.showNormal();
     QVERIFY(!(layouted.windowState() & Qt::WindowMaximized));
 
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined(Q_WS_QPA)
-//embedded may choose a different size to fit on the screen.
+    // ### fixme: embedded may choose a different size to fit on the screen.
+    // Check platforms (QTBUG-22326)
+#if 0
     QCOMPARE(layouted.size(), layouted.sizeHint());
 #endif
     layouted.showMaximized();
@@ -2008,8 +2009,8 @@ void tst_QWidget::showFullScreen()
     layouted.showNormal();
     QVERIFY(!(layouted.windowState() & Qt::WindowFullScreen));
 
-#if !defined(Q_WS_QWS) && !defined(Q_OS_WINCE) && !defined(Q_WS_QPA)
-//embedded may choose a different size to fit on the screen.
+    // ### fixme: embedded may choose a different size to fit on the screen. (QTBUG-22326)
+#if 0
     QCOMPARE(layouted.size(), layouted.sizeHint());
 #endif
 
@@ -3278,9 +3279,8 @@ void tst_QWidget::widgetAt()
 #if defined(Q_OS_WINCE)
     QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
 #endif
-#if defined(Q_WS_QPA)
-    QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue); 
-#endif
+    /// ### fixme: Check platforms
+    QEXPECT_FAIL("", "Window mask not implemented on Lighthouse QTBUG-22326", Continue);
 
     QTRY_COMPARE(QApplication::widgetAt(100,100)->objectName(), w1->objectName());
     QTRY_COMPARE(QApplication::widgetAt(101,101)->objectName(), w2->objectName());
@@ -3297,9 +3297,8 @@ void tst_QWidget::widgetAt()
 #if defined(Q_OS_WINCE)
     QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
 #endif
-#if defined(Q_WS_QPA)
-    QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue); 
-#endif
+    /// ### fixme: Check platforms
+    QEXPECT_FAIL("", "Window mask not implemented on Lighthouse  QTBUG-22326", Continue);
     QTRY_VERIFY(QApplication::widgetAt(100,100) == w1);
     QTRY_VERIFY(QApplication::widgetAt(101,101) == w2);
 
@@ -8632,7 +8631,7 @@ void tst_QWidget::maskedUpdate()
 }
 
 // Windows Mobile has no proper cursor support, so skip this test on that platform.
-#if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
+#if !defined(Q_OS_WINCE_WM)
 void tst_QWidget::syntheticEnterLeave()
 {
     class MyWidget : public QWidget
@@ -8737,7 +8736,7 @@ void tst_QWidget::syntheticEnterLeave()
 #endif
 
 // Windows Mobile has no proper cursor support, so skip this test on that platform.
-#if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
+#if !defined(Q_OS_WINCE_WM)
 void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
 {
     class SELParent : public QWidget
index a4a5ed7..a226e45 100644 (file)
@@ -122,9 +122,8 @@ void tst_QSystemTrayIcon::getSetCheck()
 
 void tst_QSystemTrayIcon::supportsMessages()
 {
-#ifdef Q_WS_QPA
+    // ### fixme: Check platforms.
     QEXPECT_FAIL("", "QTBUG-20978 QSystemTrayIcon is unimplemented for qpa", Abort);
-#endif
 
 #if !defined(Q_WS_QWS)
     QCOMPARE(QSystemTrayIcon::supportsMessages(), true );
index 306cd89..ef50a52 100644 (file)
@@ -773,9 +773,9 @@ public:
 #ifndef Q_OS_WINCE_WM
 void tst_QMenu::task258920_mouseBorder()
 {
-#ifdef Q_WS_QPA
+    // ### fixme: Check platforms
     QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa");
-#endif
+
     Menu258920 menu;
     // For styles which inherit from QWindowsStyle, styleHint(QStyle::SH_Menu_MouseTracking) is true.
     menu.setMouseTracking(true);
index c89af42..85658c2 100644 (file)
@@ -16,4 +16,4 @@ wince* {
     DEFINES += SRCDIR=\\\"$$PWD/\\\"
 }
 
-contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test  # QTBUG-20756 crashes on qpa, xcb
+contains(QT_CONFIG,xcb):CONFIG+=insignificant_test  # QTBUG-20756 crashes on xcb