[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/kexi-frameworks7-staniek] kexi/main/tests: Make Kexi main tests use the new calligra_add_t
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2015-06-30 20:24:33
Message-ID: E1ZA253-0006Ps-3Y () scm ! kde ! org
[Download RAW message or body]

Git commit 033df4f56592341b30ec3548e4787b64ff5ea2ab by Jaroslaw Staniek.
Committed on 30/06/2015 at 20:16.
Pushed by staniek into branch 'kexi-frameworks7-staniek'.

Make Kexi main tests use the new calligra_add_test() macro

+ rename paths

(still partially fails because forms are not available)

M  +2    -4    kexi/main/tests/CMakeLists.txt
R  +8    -8    kexi/main/tests/GlobalSearchTest.cpp [from: \
kexi/main/tests/TestGlobalSearch.cpp - 092% similarity] R  +3    -3    \
kexi/main/tests/GlobalSearchTest.h [from: kexi/main/tests/TestGlobalSearch.h - 089% \
similarity] R  +-    --    kexi/main/tests/data/GlobalSearchTest.kexi [from: \
kexi/main/tests/data/TestGlobalSearch.kexi - 100% similarity]

http://commits.kde.org/calligra/033df4f56592341b30ec3548e4787b64ff5ea2ab

diff --git a/kexi/main/tests/CMakeLists.txt b/kexi/main/tests/CMakeLists.txt
index d7791bb..7a73db4 100644
--- a/kexi/main/tests/CMakeLists.txt
+++ b/kexi/main/tests/CMakeLists.txt
@@ -1,4 +1,2 @@
-calligra_build_test(GlobalSearch)
-target_link_libraries(TestGlobalSearch Qt5::Test KDb
-                                       keximain kexicore kexiextendedwidgets)
-
+set(LIBS keximain kexicore kexiextendedwidgets)
+calligra_add_test(kexi GlobalSearchTest ${LIBS})
diff --git a/kexi/main/tests/TestGlobalSearch.cpp \
b/kexi/main/tests/GlobalSearchTest.cpp similarity index 92%
rename from kexi/main/tests/TestGlobalSearch.cpp
rename to kexi/main/tests/GlobalSearchTest.cpp
index 1c1533c..59ff84f 100644
--- a/kexi/main/tests/TestGlobalSearch.cpp
+++ b/kexi/main/tests/GlobalSearchTest.cpp
@@ -17,7 +17,7 @@
  * Boston, MA 02110-1301, USA.
 */
 
-#include "TestGlobalSearch.h"
+#include "GlobalSearchTest.h"
 
 #include <core/kexi.h>
 #include <core/kexipartitem.h>
@@ -37,9 +37,9 @@
 
 const int GUI_DELAY = 10;
 
-#define FILES_DATA_DIR KDESRCDIR "data"
+#define FILES_DATA_DIR CURRENT_SOURCE_DIR "data"
 
-void TestGlobalSearch::initTestCase()
+void GlobalSearchTest::initTestCase()
 {
 }
 
@@ -64,13 +64,13 @@ public:
     char **vals;
 };
 
-TestGlobalSearch::TestGlobalSearch(int argc, char **argv, bool goToEventLoop)
+GlobalSearchTest::GlobalSearchTest(int &argc, char **argv, bool goToEventLoop)
  : m_argc(argc), m_argv(argv), m_goToEventLoop(goToEventLoop)
 {
 }
-void TestGlobalSearch::testGlobalSearch()
+void GlobalSearchTest::testGlobalSearch()
 {
-    QString filename(QFile::decodeName(FILES_DATA_DIR "/TestGlobalSearch.kexi"));
+    QString filename(QFile::decodeName(FILES_DATA_DIR "/GlobalSearchTest.kexi"));
     qDebug() << filename;
     NewArgs args(m_argv);
     args.vals[args.count - 1] = qstrdup(QFile::encodeName(filename).constData());
@@ -129,7 +129,7 @@ void TestGlobalSearch::testGlobalSearch()
     }
 }
 
-void TestGlobalSearch::cleanupTestCase()
+void GlobalSearchTest::cleanupTestCase()
 {
 }
 
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
     }
 
     // Actual test
-    TestGlobalSearch tc(realCount, realVals, goToEventLoop);
+    GlobalSearchTest tc(realCount, realVals, goToEventLoop);
     int result = QTest::qExec(&tc, realCount, realVals);
 
     // Clean up
diff --git a/kexi/main/tests/TestGlobalSearch.h b/kexi/main/tests/GlobalSearchTest.h
similarity index 89%
rename from kexi/main/tests/TestGlobalSearch.h
rename to kexi/main/tests/GlobalSearchTest.h
index 4d8f468..305a01f 100644
--- a/kexi/main/tests/TestGlobalSearch.h
+++ b/kexi/main/tests/GlobalSearchTest.h
@@ -22,17 +22,17 @@
 
 #include <QObject>
 
-class TestGlobalSearch : public QObject
+class GlobalSearchTest : public QObject
 {
     Q_OBJECT
 public:
-    TestGlobalSearch(int argc, char **argv, bool goToEventLoop);
+    GlobalSearchTest(int &argc, char **argv, bool goToEventLoop);
 private Q_SLOTS:
     void initTestCase();
     void testGlobalSearch();
     void cleanupTestCase();
 private:
-    const int m_argc;
+    const int &m_argc;
     char **m_argv;
     bool m_goToEventLoop;
 };
diff --git a/kexi/main/tests/data/TestGlobalSearch.kexi \
b/kexi/main/tests/data/GlobalSearchTest.kexi similarity index 100%
rename from kexi/main/tests/data/TestGlobalSearch.kexi
rename to kexi/main/tests/data/GlobalSearchTest.kexi


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic