test module

This commit is contained in:
Hamed Masafi 2020-07-29 13:20:32 +04:30
parent 85d5e07a3c
commit 4dd6a7296f
95 changed files with 113 additions and 2579 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "3rdparty/serializer"]
path = 3rdparty/serializer
[submodule "src/nut/3rdparty/serializer"]
path = src/nut/3rdparty/serializer
url = https://github.com/HamedMasafi/Serializer.git

13
.qmake.conf Normal file
View File

@ -0,0 +1,13 @@
load(qt_build_config)
CONFIG += warning_clean exceptions qt_module_build c++17
DEFINES += QT_DEPRECATED_WARNINGS QT_ASCII_CAST_WARNINGS
MODULE_VERSION = 0.6.0
# had to be added because std::visit only works on macos 10.14 and above
# remove again once Qt raises the value to 10.14!
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0

2403
Doxyfile

File diff suppressed because it is too large Load Diff

11
deploy.json Normal file
View File

@ -0,0 +1,11 @@
{
"title": "QtNut",
"description": "Advanced, Powerful and easy to use ORM for Qt5.",
"modules": [ "QtNut" ],
"dependencies": [],
"excludes": [],
"license": {
"name": "LGPL-3",
"path": "LICENSE"
}
}

View File

@ -1 +0,0 @@
#include "../src/database.h"

View File

@ -1 +0,0 @@
#include "../src/types/dbgeography.h"

View File

@ -1,7 +0,0 @@
#include "../src/table.h"
#include "../src/database.h"
#include "../src/sqlmodel.h"
#include "../src/tableset.h"
#include "../src/tablemodel.h"
#include "../src/query.h"

View File

@ -1 +0,0 @@
#include "../src/query.h"

View File

@ -1 +0,0 @@
#include "../src/sqlmodel.h"

View File

@ -1 +0,0 @@
#include "../src/table.h"

View File

@ -1 +0,0 @@
#include "../src/tablemodel.h"

View File

@ -1 +0,0 @@
#include "../src/tableset.h"

View File

@ -1 +0,0 @@
#include "../src/database.h"

View File

@ -1 +0,0 @@
#include "../src/types/dbgeography.h"

View File

@ -1,42 +0,0 @@
#!/bin/bash
src_dir="src"
namespace_name="nut"
#ns=$(echo $namespace_name|awk '{print tolower($0)}')
Ns="Nut"
NS=$(echo $namespace_name|awk '{print toupper($0)}')
create_sub_folder=true
exec 3< <(egrep -o "class\s${NS}_EXPORT\s(\S+)" "../$src_dir" -R 2>&1)
pattern="\.\.\/$src_dir\/([a-z]+)\.h\:class\s${NS}_EXPORT\s(\w+)"
echo "" > "$Ns"
echo "" > "$ns.h"
if [[ -z create_sub_folder ]]; then
mkdir -p $Ns
fi
while read line; do
if [[ $line =~ $pattern ]]; then
header=${BASH_REMATCH[1]}
class=${BASH_REMATCH[2]}
echo "#include \"../$src_dir/$header.h\"" > $class
echo "#include \"../$src_dir/$header.h\"" > "$header.h"
if [[ -z create_sub_folder ]]; then
echo "#include \"../$src_dir/$header.h\"" > "$Ns/$class"
echo "#include \"../$src_dir/$header.h\"" > "$Ns/$header.h"
fi
echo "#include \"../$src_dir/$header.h\"" >> "$Ns"
echo "#include \"../$src_dir/$header.h\"" >> "$ns.h"
fi
echo $Ns
done <&3
exec 3<&-

View File

@ -1,7 +0,0 @@
#include "../src/table.h"
#include "../src/database.h"
#include "../src/sqlmodel.h"
#include "../src/tableset.h"
#include "../src/tablemodel.h"
#include "../src/query.h"

View File

@ -1 +0,0 @@
#include "../src/query.h"

View File

@ -1 +0,0 @@
#include "../src/sqlmodel.h"

View File

@ -1 +0,0 @@
#include "../src/table.h"

View File

@ -1 +0,0 @@
#include "../src/tablemodel.h"

View File

@ -1 +0,0 @@
#include "../src/tableset.h"

View File

@ -1,6 +1,2 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += \
src \
test
load(qt_parts)
system($$[QT_INSTALL_BINS]/syncqt.pl -version 0.6.0 -outdir $$OUT_PWD)

View File

@ -1,24 +0,0 @@
project = Nut
description = Advanced, Powerful and easy to use ORM for Qt5
version = 0.1
outputdir = doc
source += src/query.cpp
headerdirs += src
sourcedirs += src
exampledirs = .
qhp.projects = Nut
qhp.qtestclass.file = nut.qhp
qhp.qtestclass.namespace = org.kaj.nut.0.1
qhp.qtestclass.virtualFolder = nut
qhp.qtestclass.indexTitle = nut
qhp.qtestclass.indexRoot =
qhp.qtestclass.filterAttributes = nut 0.1 qtrefdoc
qhp.qtestclass.customFilters.Qt.name = qtestclass 0.1
qhp.qtestclass.customFilters.Qt.filterAttributes = qtestclass 0.1

1
src/nut/3rdparty/serializer vendored Submodule

@ -0,0 +1 @@
Subproject commit 0e794d6317595d077e95e8a06f1f3a8c92543b05

76
src/nut/nut.pro Normal file
View File

@ -0,0 +1,76 @@
QT += sql gui
TARGET = nut
TEMPLATE = lib
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS NUT_SHARED NUT_BUILD_LIB
DEFINES += NUT_SHARED_POINTER
HEADERS += \
$$PWD/generators/sqlgeneratorbase_p.h \
$$PWD/generators/postgresqlgenerator.h \
$$PWD/generators/mysqlgenerator.h \
$$PWD/generators/sqlitegenerator.h \
$$PWD/generators/sqlservergenerator.h \
$$PWD/tablesetbasedata.h \
$$PWD/types/dbgeography.h \
$$PWD/tableset.h \
$$PWD/defines_p.h \
$$PWD/defines.h \
$$PWD/query.h \
$$PWD/databasemodel.h \
$$PWD/changelogtable.h \
$$PWD/tablesetbase_p.h \
$$PWD/querybase_p.h \
$$PWD/tablemodel.h \
$$PWD/query_p.h \
$$PWD/table.h \
$$PWD/database.h \
$$PWD/database_p.h \
$$PWD/serializableobject.h \
$$PWD/sqlmodel.h \
$$PWD/sqlmodel_p.h \
$$PWD/phrase.h \
$$PWD/phrases/abstractfieldphrase.h \
$$PWD/phrases/assignmentphrase.h \
$$PWD/phrases/assignmentphraselist.h \
$$PWD/phrases/conditionalphrase.h \
$$PWD/phrases/fieldphrase.h \
$$PWD/phrases/phrasedata.h \
$$PWD/phrases/phrasedatalist.h \
$$PWD/phrases/phraselist.h \
$$PWD/phrases/datephrase.h \
$$PWD/table_p.h
SOURCES += \
$$PWD/generators/sqlgeneratorbase.cpp \
$$PWD/generators/postgresqlgenerator.cpp \
$$PWD/generators/mysqlgenerator.cpp \
$$PWD/generators/sqlitegenerator.cpp \
$$PWD/generators/sqlservergenerator.cpp \
$$PWD/types/dbgeography.cpp \
$$PWD/tableset.cpp \
$$PWD/query.cpp \
$$PWD/databasemodel.cpp \
$$PWD/tablesetbase.cpp \
$$PWD/changelogtable.cpp \
$$PWD/querybase.cpp \
$$PWD/tablemodel.cpp \
$$PWD/table.cpp \
$$PWD/database.cpp \
$$PWD/serializableobject.cpp \
$$PWD/sqlmodel.cpp \
$$PWD/phrase.cpp \
$$PWD/phrases/abstractfieldphrase.cpp \
$$PWD/phrases/assignmentphrase.cpp \
$$PWD/phrases/assignmentphraselist.cpp \
$$PWD/phrases/conditionalphrase.cpp \
$$PWD/phrases/fieldphrase.cpp \
$$PWD/phrases/phrasedata.cpp \
$$PWD/phrases/phrasedatalist.cpp \
$$PWD/phrases/phraselist.cpp \
$$PWD/phrases/datephrase.cpp
include($$PWD/3rdparty/serializer/src/src.pri)

View File

@ -1,76 +1,5 @@
QT += sql gui
TEMPLATE = subdirs
TARGET = nut
TEMPLATE = lib
CONFIG += c++11
SUBDIRS += nut
DEFINES += QT_DEPRECATED_WARNINGS NUT_SHARED NUT_BUILD_LIB
DEFINES += NUT_SHARED_POINTER
HEADERS += \
$$PWD/generators/sqlgeneratorbase_p.h \
$$PWD/generators/postgresqlgenerator.h \
$$PWD/generators/mysqlgenerator.h \
$$PWD/generators/sqlitegenerator.h \
$$PWD/generators/sqlservergenerator.h \
$$PWD/tablesetbasedata.h \
$$PWD/types/dbgeography.h \
$$PWD/tableset.h \
$$PWD/defines_p.h \
$$PWD/defines.h \
$$PWD/query.h \
$$PWD/databasemodel.h \
$$PWD/changelogtable.h \
$$PWD/tablesetbase_p.h \
$$PWD/querybase_p.h \
$$PWD/tablemodel.h \
$$PWD/query_p.h \
$$PWD/table.h \
$$PWD/database.h \
$$PWD/database_p.h \
$$PWD/serializableobject.h \
$$PWD/sqlmodel.h \
$$PWD/sqlmodel_p.h \
$$PWD/phrase.h \
$$PWD/phrases/abstractfieldphrase.h \
$$PWD/phrases/assignmentphrase.h \
$$PWD/phrases/assignmentphraselist.h \
$$PWD/phrases/conditionalphrase.h \
$$PWD/phrases/fieldphrase.h \
$$PWD/phrases/phrasedata.h \
$$PWD/phrases/phrasedatalist.h \
$$PWD/phrases/phraselist.h \
$$PWD/phrases/datephrase.h \
$$PWD/table_p.h
SOURCES += \
$$PWD/generators/sqlgeneratorbase.cpp \
$$PWD/generators/postgresqlgenerator.cpp \
$$PWD/generators/mysqlgenerator.cpp \
$$PWD/generators/sqlitegenerator.cpp \
$$PWD/generators/sqlservergenerator.cpp \
$$PWD/types/dbgeography.cpp \
$$PWD/tableset.cpp \
$$PWD/query.cpp \
$$PWD/databasemodel.cpp \
$$PWD/tablesetbase.cpp \
$$PWD/changelogtable.cpp \
$$PWD/querybase.cpp \
$$PWD/tablemodel.cpp \
$$PWD/table.cpp \
$$PWD/database.cpp \
$$PWD/serializableobject.cpp \
$$PWD/sqlmodel.cpp \
$$PWD/phrase.cpp \
$$PWD/phrases/abstractfieldphrase.cpp \
$$PWD/phrases/assignmentphrase.cpp \
$$PWD/phrases/assignmentphraselist.cpp \
$$PWD/phrases/conditionalphrase.cpp \
$$PWD/phrases/fieldphrase.cpp \
$$PWD/phrases/phrasedata.cpp \
$$PWD/phrases/phrasedatalist.cpp \
$$PWD/phrases/phraselist.cpp \
$$PWD/phrases/datephrase.cpp
include($$PWD/../3rdparty/serializer/src/src.pri)
QMAKE_EXTRA_TARGETS += run-tests

5
sync.profile Normal file
View File

@ -0,0 +1,5 @@
%modules = (
"QtNut" => "$basedir/src/nut",
);
$publicclassregexp = "^QtJsonSerializer::(?!__private::|MetaWriters::Implementations::|TypeExtractors::|Exception).+";