Use QSKIP instead of QTEST_NOOP_MAIN so that the user receives a clear
indication that this test isn't testing anything when not built for X11.
Change-Id: I9e9ef8fe738c06eb86f2ce398f6a515bf17e220a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
load(qttest_p4)
+QT += widgets
SOURCES += tst_qx11info.cpp
#include <QtTest/QtTest>
-
-#ifdef Q_WS_X11
-
#include <QApplication>
#include <QX11Info>
{
Q_OBJECT
+#ifndef Q_WS_X11
+public slots:
+ void initTestCase();
+#else
private slots:
void staticFunctionsBeforeQApplication();
+#endif
};
+#ifndef Q_WS_X11
+void tst_QX11Info::initTestCase()
+{
+ QSKIP("This test is only valid for X11", SkipAll);
+}
+
+#else
+
void tst_QX11Info::staticFunctionsBeforeQApplication()
{
QVERIFY(!QApplication::instance());
QCOMPARE(appTime, 0ul);
}
-QTEST_APPLESS_MAIN(tst_QX11Info)
+#endif
+QTEST_APPLESS_MAIN(tst_QX11Info)
#include "tst_qx11info.moc"
-
-#else // !Q_WS_X11
-
-QTEST_NOOP_MAIN
-
-#endif