From: Olivier Goffart Date: Tue, 12 Jul 2016 09:07:12 +0000 (+0200) Subject: Qt4: don't require a X server in the tests X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1111^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=19a52b9e6be907e532adeff0646bb245b46f17cb;p=nextcloud-desktop.git Qt4: don't require a X server in the tests Issue #5069 (cherry picked from commit 927a8b5071a8ee360ea4a1b24d093d8e9acacf18 and a4310f0f5c4855c5249ffb1355c6fc039e141316) --- diff --git a/test/testchecksumvalidator.cpp b/test/testchecksumvalidator.cpp index a0fc934c9..c83f37377 100644 --- a/test/testchecksumvalidator.cpp +++ b/test/testchecksumvalidator.cpp @@ -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 diff --git a/test/testfolderwatcher.cpp b/test/testfolderwatcher.cpp index e2b8eb423..89d5d62d8 100644 --- a/test/testfolderwatcher.cpp +++ b/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 diff --git a/test/testxmlparse.cpp b/test/testxmlparse.cpp index 5e49f7ee8..4b7f7bd69 100644 --- a/test/testxmlparse.cpp +++ b/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