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/Te= stGlobalSearch.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 kexiextendedwidge= ts) - +set(LIBS keximain kexicore kexiextendedwidgets) +calligra_add_test(kexi GlobalSearchTest ${LIBS}) diff --git a/kexi/main/tests/TestGlobalSearch.cpp b/kexi/main/tests/GlobalS= earchTest.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 #include @@ -37,9 +37,9 @@ = const int GUI_DELAY =3D 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 goToEventLo= op) +GlobalSearchTest::GlobalSearchTest(int &argc, char **argv, bool goToEventL= oop) : m_argc(argc), m_argv(argv), m_goToEventLoop(goToEventLoop) { } -void TestGlobalSearch::testGlobalSearch() +void GlobalSearchTest::testGlobalSearch() { - QString filename(QFile::decodeName(FILES_DATA_DIR "/TestGlobalSearch.k= exi")); + QString filename(QFile::decodeName(FILES_DATA_DIR "/GlobalSearchTest.k= exi")); qDebug() << filename; NewArgs args(m_argv); args.vals[args.count - 1] =3D qstrdup(QFile::encodeName(filename).cons= tData()); @@ -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 =3D QTest::qExec(&tc, realCount, realVals); = // Clean up diff --git a/kexi/main/tests/TestGlobalSearch.h b/kexi/main/tests/GlobalSea= rchTest.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 = -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/d= ata/GlobalSearchTest.kexi similarity index 100% rename from kexi/main/tests/data/TestGlobalSearch.kexi rename to kexi/main/tests/data/GlobalSearchTest.kexi