Просмотр исходного кода

For tests we do not need a xserver running.

Use for tests QTEST_GUILESS_MAIN and QTEST_APPLESS_MAIN.
Hefee 9 лет назад
Родитель
Сommit
edb3759684

+ 1 - 1
test/owncloud_add_test.cmake

@@ -11,7 +11,7 @@ macro(owncloud_add_test test_class additional_cpp)
     string(TOLOWER "${OWNCLOUD_TEST_CLASS}" OWNCLOUD_TEST_CLASS_LOWERCASE)
 
     add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
-    qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml Network Gui Widgets)
+    qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml Network)
 
     target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
         updater

+ 6 - 1
test/testchecksumvalidator.cpp

@@ -150,5 +150,10 @@ using namespace OCC;
     }
 };
 
-QTEST_MAIN(TestChecksumValidator)
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+    QTEST_MAIN(TestChecksumValidator)
+#else
+    QTEST_GUILESS_MAIN(TestChecksumValidator)
+#endif
+
 #include "testchecksumvalidator.moc"

+ 1 - 1
test/testconcaturl.cpp

@@ -100,5 +100,5 @@ private slots:
 
 };
 
-QTEST_MAIN(TestConcatUrl)
+QTEST_APPLESS_MAIN(TestConcatUrl)
 #include "testconcaturl.moc"

+ 1 - 1
test/testcsyncsqlite.cpp

@@ -85,5 +85,5 @@ private slots:
 
 };
 
-QTEST_MAIN(TestCSyncSqlite)
+QTEST_APPLESS_MAIN(TestCSyncSqlite)
 #include "testcsyncsqlite.moc"

+ 1 - 1
test/testexcludedfiles.cpp

@@ -46,5 +46,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestExcludedFiles)
+QTEST_APPLESS_MAIN(TestExcludedFiles)
 #include "testexcludedfiles.moc"

+ 1 - 1
test/testfilesystem.cpp

@@ -87,5 +87,5 @@ private slots:
 
 };
 
-QTEST_MAIN(TestFileSystem)
+QTEST_APPLESS_MAIN(TestFileSystem)
 #include "testfilesystem.moc"

+ 1 - 1
test/testfolder.cpp

@@ -41,5 +41,5 @@ private slots:
 
 };
 
-QTEST_MAIN(TestFolder)
+QTEST_APPLESS_MAIN(TestFolder)
 #include "testfolder.moc"

+ 1 - 1
test/testfolderman.cpp

@@ -118,5 +118,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestFolderMan)
+QTEST_APPLESS_MAIN(TestFolderMan)
 #include "testfolderman.moc"

+ 6 - 1
test/testfolderwatcher.cpp

@@ -170,5 +170,10 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestFolderWatcher)
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+    QTEST_MAIN(TestFolderWatcher)
+#else
+    QTEST_GUILESS_MAIN(TestFolderWatcher)
+#endif
+
 #include "testfolderwatcher.moc"

+ 1 - 1
test/testinotifywatcher.cpp

@@ -69,5 +69,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestInotifyWatcher)
+QTEST_APPLESS_MAIN(TestInotifyWatcher)
 #include "testinotifywatcher.moc"

+ 1 - 1
test/testnetrcparser.cpp

@@ -72,5 +72,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestNetrcParser)
+QTEST_APPLESS_MAIN(TestNetrcParser)
 #include "testnetrcparser.moc"

+ 1 - 1
test/testowncloudpropagator.cpp

@@ -78,5 +78,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestOwncloudPropagator)
+QTEST_APPLESS_MAIN(TestOwncloudPropagator)
 #include "testowncloudpropagator.moc"

+ 1 - 1
test/testownsql.cpp

@@ -149,5 +149,5 @@ private:
     SqlDatabase _db;
 };
 
-QTEST_MAIN(TestOwnSql)
+QTEST_APPLESS_MAIN(TestOwnSql)
 #include "testownsql.moc"

+ 1 - 1
test/testsyncfileitem.cpp

@@ -65,5 +65,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestSyncFileItem)
+QTEST_APPLESS_MAIN(TestSyncFileItem)
 #include "testsyncfileitem.moc"

+ 1 - 1
test/testsyncjournaldb.cpp

@@ -171,5 +171,5 @@ private:
     SyncJournalDb _db;
 };
 
-QTEST_MAIN(TestSyncJournalDB)
+QTEST_APPLESS_MAIN(TestSyncJournalDB)
 #include "testsyncjournaldb.moc"

+ 1 - 1
test/testupdater.cpp

@@ -30,5 +30,5 @@ private slots:
 
 };
 
-QTEST_MAIN(TestUpdater)
+QTEST_APPLESS_MAIN(TestUpdater)
 #include "testupdater.moc"

+ 1 - 1
test/testutility.cpp

@@ -160,5 +160,5 @@ private slots:
     }
 };
 
-QTEST_MAIN(TestUtility)
+QTEST_APPLESS_MAIN(TestUtility)
 #include "testutility.moc"

+ 6 - 1
test/testxmlparse.cpp

@@ -441,5 +441,10 @@ private slots:
 
 };
 
-QTEST_MAIN(TestXmlParse)
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+    QTEST_MAIN(TestXmlParse)
+#else
+    QTEST_GUILESS_MAIN(TestXmlParse)
+#endif
+
 #include "testxmlparse.moc"