]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Qt4: don't require a X server in the tests
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 12 Jul 2016 09:07:12 +0000 (11:07 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Mon, 1 Aug 2016 09:57:21 +0000 (11:57 +0200)
Issue #5069

(cherry picked from commit 927a8b5071a8ee360ea4a1b24d093d8e9acacf18 and
a4310f0f5c4855c5249ffb1355c6fc039e141316)

test/testchecksumvalidator.cpp
test/testfolderwatcher.cpp
test/testxmlparse.cpp

index a0fc934c9f531bbea5027e260a9d66b9bfc3c7bf..c83f3737723178d8716e4dd64fd2efabd0ce0fb9 100644 (file)
@@ -151,7 +151,13 @@ using namespace OCC;
 };
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QTEST_MAIN(TestChecksumValidator)
+// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+    TestChecksumValidator tc;
+    return QTest::qExec(&tc, argc, argv);
+}
 #else
     QTEST_GUILESS_MAIN(TestChecksumValidator)
 #endif
index e2b8eb42391ac33aa716217adc3795ff32b681af..89d5d62d8f616c23caf337bbf49a1080712b11f9 100644 (file)
@@ -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
index 5e49f7ee8d526c98a5b87604ff889f9796beadf4..4b7f7bd691976202b7b34d80750a9041a4e7bad5 100644 (file)
@@ -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