From 19a52b9e6be907e532adeff0646bb245b46f17cb Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 12 Jul 2016 11:07:12 +0200 Subject: [PATCH] Qt4: don't require a X server in the tests Issue #5069 (cherry picked from commit 927a8b5071a8ee360ea4a1b24d093d8e9acacf18 and a4310f0f5c4855c5249ffb1355c6fc039e141316) --- test/testchecksumvalidator.cpp | 8 +++++++- test/testfolderwatcher.cpp | 8 +++++++- test/testxmlparse.cpp | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) 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 -- 2.30.2