Преглед изворни кода

Qt4: don't require a X server in the tests

Previous commit was not enough
Olivier Goffart пре 9 година
родитељ
комит
927a8b5071
2 измењених фајлова са 14 додато и 2 уклоњено
  1. 7 1
      test/testfolderwatcher.cpp
  2. 7 1
      test/testxmlparse.cpp

+ 7 - 1
test/testfolderwatcher.cpp

@@ -171,7 +171,13 @@ private slots:
 };
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QTEST_MAIN(TestFolderWatcher)
+// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+    TestFolderWatcher tc;
+    return QTest::qExec(&tc, argc, argv);
+}
 #else
     QTEST_GUILESS_MAIN(TestFolderWatcher)
 #endif

+ 7 - 1
test/testxmlparse.cpp

@@ -442,7 +442,13 @@ private slots:
 };
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QTEST_MAIN(TestXmlParse)
+// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+    TestXmlParse tc;
+    return QTest::qExec(&tc, argc, argv);
+}
 #else
     QTEST_GUILESS_MAIN(TestXmlParse)
 #endif