summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/backends/CMakeLists.txt19
-rw-r--r--src/backends/PostgreSQL/CMakeLists.txt1
-rw-r--r--src/backends/krecipesdbiface.h (renamed from src/krecipesdbiface.h)0
-rw-r--r--src/backends/propertycalculator.cpp (renamed from src/propertycalculator.cpp)0
-rw-r--r--src/backends/propertycalculator.h (renamed from src/propertycalculator.h)0
-rw-r--r--src/dialogs/CMakeLists.txt4
-rw-r--r--src/importers/CMakeLists.txt2
-rw-r--r--src/tests/CMakeLists.txt93
-rw-r--r--src/tests/kretest.cpp7
-rw-r--r--src/tests/mmftest.cpp7
-rw-r--r--src/tests/mx2test.cpp7
-rw-r--r--src/tests/mxptest.cpp7
-rw-r--r--src/tests/nyctest.cpp7
-rw-r--r--src/tests/recipemltest.cpp7
-rw-r--r--src/tests/rezkonvtest.cpp7
16 files changed, 157 insertions, 16 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5634bb3..2fea57e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/backends
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
${TDE_INCLUDE_DIR}
@@ -20,6 +21,7 @@ add_subdirectory( dialogs )
add_subdirectory( exporters )
add_subdirectory( importers )
add_subdirectory( widgets )
+add_subdirectory( tests )
##### krecipes (executable)
@@ -27,8 +29,7 @@ add_subdirectory( widgets )
tde_add_executable( krecipes AUTOMOC
SOURCES
main.cpp krecipes.cpp krecipesview.cpp pref.cpp
- krecipesiface.skel krecipesdbiface.skel
- propertycalculator.cpp setupwizard.cpp
+ krecipesiface.skel setupwizard.cpp
shoppingcalculator.cpp kstartuplogo.cpp
recipeactionshandler.cpp recipefilter.cpp
convert_sqlite3.cpp klomanager.cpp
diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt
index 42ba0e8..2601e9d 100644
--- a/src/backends/CMakeLists.txt
+++ b/src/backends/CMakeLists.txt
@@ -1,6 +1,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src
)
@@ -16,16 +17,24 @@ tde_conditional_add_subdirectory( WITH_SQLITE3 SQLite )
# backend libraries list
set( BACKEND_LIBRARIES "" )
if( WITH_MYSQL )
- list( APPEND BACKEND_LIBRARIES "krecmysql-static" )
+ list( APPEND BACKEND_LIBRARIES krecmysql-static )
endif( )
if( WITH_POSTGRESQL )
- list( APPEND BACKEND_LIBRARIES "krecpsql-static" )
+ list( APPEND BACKEND_LIBRARIES krecpsql-static )
endif( )
if( WITH_SQLITE3 )
- list( APPEND BACKEND_LIBRARIES "krecsqlite-static" )
+ list( APPEND BACKEND_LIBRARIES krecsqlite-static )
endif( )
tde_add_library( krecipesdbs STATIC_PIC AUTOMOC
- SOURCES recipedb.cpp qsqlrecipedb.cpp progressinterface.cpp
- LINK ${BACKEND_LIBRARIES}
+ SOURCES
+ recipedb.cpp qsqlrecipedb.cpp progressinterface.cpp propertycalculator.cpp
+ krecipesdbiface.skel
+ LINK
+ datablocks-static krecipesimporters-static ${BACKEND_LIBRARIES}
+ tdeio-shared
)
+
+# Increase the number of times the linker scan for circular dependencies
+# in static libraries (required for building tests)
+set_target_properties( krecipesdbs-static PROPERTIES LINK_INTERFACE_MULTIPLICITY 3 )
diff --git a/src/backends/PostgreSQL/CMakeLists.txt b/src/backends/PostgreSQL/CMakeLists.txt
index fa825e0..84f23f7 100644
--- a/src/backends/PostgreSQL/CMakeLists.txt
+++ b/src/backends/PostgreSQL/CMakeLists.txt
@@ -7,6 +7,7 @@ link_directories(
${LIBPQ_LIBRARY_DIRS}
)
+
##### krecpsql (static)
tde_add_library( krecpsql STATIC_PIC AUTOMOC
diff --git a/src/krecipesdbiface.h b/src/backends/krecipesdbiface.h
index f5447dc..f5447dc 100644
--- a/src/krecipesdbiface.h
+++ b/src/backends/krecipesdbiface.h
diff --git a/src/propertycalculator.cpp b/src/backends/propertycalculator.cpp
index 8310b14..8310b14 100644
--- a/src/propertycalculator.cpp
+++ b/src/backends/propertycalculator.cpp
diff --git a/src/propertycalculator.h b/src/backends/propertycalculator.h
index 3553d52..3553d52 100644
--- a/src/propertycalculator.h
+++ b/src/backends/propertycalculator.h
diff --git a/src/dialogs/CMakeLists.txt b/src/dialogs/CMakeLists.txt
index cc48e9c..6c2e670 100644
--- a/src/dialogs/CMakeLists.txt
+++ b/src/dialogs/CMakeLists.txt
@@ -1,6 +1,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/backends
)
@@ -18,13 +19,12 @@ tde_add_library( krecipesdialogs STATIC_PIC AUTOMOC
shoppinglistdialog.cpp shoppinglistviewdialog.cpp
selectcategoriesdialog.cpp categorieseditordialog.cpp
authorsdialog.cpp selectauthorsdialog.cpp
- resizerecipedialog.cpp
+ resizerecipedialog.cpp setupdisplay.cpp
dietviewdialog.cpp ingredientmatcherdialog.cpp
usdadatadialog.cpp prepmethodsdialog.cpp
createcategorydialog.cpp borderdialog.cpp
refineshoppinglistdialog.cpp pagesetupdialog.cpp
dbimportdialog.cpp createunitdialog.cpp
- setupdisplay.cpp
ingredientparserdialog.cpp ingredientgroupsdialog.cpp
editratingdialog.cpp similarcategoriesdialog.cpp
conversiondialog.cpp createingredientweightdialog.cpp
diff --git a/src/importers/CMakeLists.txt b/src/importers/CMakeLists.txt
index 65eb42a..682dfe8 100644
--- a/src/importers/CMakeLists.txt
+++ b/src/importers/CMakeLists.txt
@@ -10,4 +10,6 @@ tde_add_library( krecipesimporters STATIC_PIC AUTOMOC
SOURCES
mx2importer.cpp mmfimporter.cpp mxpimporter.cpp nycgenericimporter.cpp recipemlimporter.cpp
baseimporter.cpp kreimporter.cpp rezkonvimporter.cpp kredbimporter.cpp
+ LINK
+ tdeio-shared
)
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
new file mode 100644
index 0000000..8047d10
--- /dev/null
+++ b/src/tests/CMakeLists.txt
@@ -0,0 +1,93 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src/importers
+ ${CMAKE_SOURCE_DIR}/src/exporters
+ ${CMAKE_BINARY_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${TDE_INCLUDE_DIR}
+)
+
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+ ${TDE_LIB_DIR}
+)
+
+
+##### kretest (executable)
+
+tde_add_check_executable( kretest AUTOMOC
+ SOURCES kretest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### mmftest (executable)
+
+tde_add_check_executable( mmftest AUTOMOC
+ SOURCES mmftest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### mx2test (executable)
+
+tde_add_check_executable( mx2test AUTOMOC
+ SOURCES mx2test.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### mxptest (executable)
+
+tde_add_check_executable( mxptest AUTOMOC
+ SOURCES mxptest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### rezkonvtest (executable)
+
+tde_add_check_executable( rezkonvtest AUTOMOC
+ SOURCES rezkonvtest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### nyctest (executable)
+
+tde_add_check_executable( nyctest AUTOMOC
+ SOURCES nyctest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
+
+
+##### recipemltest (executable)
+
+tde_add_check_executable( recipemltest AUTOMOC
+ SOURCES recipemltest.cpp
+ LINK
+ krecipesexporters-static krecipesimporters-static
+ krecipesdbs-static datablocks-static
+ tdecore-shared tdeio-shared
+)
diff --git a/src/tests/kretest.cpp b/src/tests/kretest.cpp
index 10c88c2..941e30d 100644
--- a/src/tests/kretest.cpp
+++ b/src/tests/kretest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
#include <tqfile.h>
@@ -23,7 +25,10 @@
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "kretest");
+ TDEAboutData *about = new TDEAboutData("kretest", I18N_NOOP("kretest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating KreImporter.\n");
KreImporter importer;
diff --git a/src/tests/mmftest.cpp b/src/tests/mmftest.cpp
index 453fcaa..a534721 100644
--- a/src/tests/mmftest.cpp
+++ b/src/tests/mmftest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -24,7 +26,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "mmftest");
+ TDEAboutData *about = new TDEAboutData("mmftest", I18N_NOOP("mmftest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating MMFImporter.\n");
MMFImporter importer;
diff --git a/src/tests/mx2test.cpp b/src/tests/mx2test.cpp
index daa379e..5388b20 100644
--- a/src/tests/mx2test.cpp
+++ b/src/tests/mx2test.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -22,7 +24,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "mx2test");
+ TDEAboutData *about = new TDEAboutData("mx2test", I18N_NOOP("mx2test"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating MX2Importer.\n");
MX2Importer importer;
diff --git a/src/tests/mxptest.cpp b/src/tests/mxptest.cpp
index 3c56a6f..b765a99 100644
--- a/src/tests/mxptest.cpp
+++ b/src/tests/mxptest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -22,7 +24,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "mxptest");
+ TDEAboutData *about = new TDEAboutData("mxptest", I18N_NOOP("mxptest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating MXPImporter.\n");
MXPImporter importer;
diff --git a/src/tests/nyctest.cpp b/src/tests/nyctest.cpp
index 724b6a0..ecc01bb 100644
--- a/src/tests/nyctest.cpp
+++ b/src/tests/nyctest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -22,7 +24,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "nyctest");
+ TDEAboutData *about = new TDEAboutData("nyctest", I18N_NOOP("nyctest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating NYCGenericImporter.\n");
NYCGenericImporter importer;
diff --git a/src/tests/recipemltest.cpp b/src/tests/recipemltest.cpp
index eb11880..cef3adb 100644
--- a/src/tests/recipemltest.cpp
+++ b/src/tests/recipemltest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -24,7 +26,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "recipemltest");
+ TDEAboutData *about = new TDEAboutData("recipemltest", I18N_NOOP("recipemltest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating RecipeMLImporter.\n");
RecipeMLImporter importer;
diff --git a/src/tests/rezkonvtest.cpp b/src/tests/rezkonvtest.cpp
index d9b8022..f2773ce 100644
--- a/src/tests/rezkonvtest.cpp
+++ b/src/tests/rezkonvtest.cpp
@@ -8,7 +8,9 @@
* (at your option) any later version. *
***************************************************************************/
+#include <tdeaboutdata.h>
#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
#include <tqstring.h>
@@ -24,7 +26,10 @@ using std::endl;
int
main(int argc, char *argv[])
{
- TDEApplication a(argc, argv, "rezkonvtest");
+ TDEAboutData *about = new TDEAboutData("rezkonvtest", I18N_NOOP("rezkonvtest"), "1.0",
+ nullptr, TDEAboutData::License_GPL, nullptr, nullptr, nullptr, nullptr);
+ TDECmdLineArgs::init(argc, argv, about);
+ TDEApplication a;
printf("Creating RezkonvImporter.\n");
RezkonvImporter importer;