wip: make auto tests
This commit is contained in:
parent
594f0501e2
commit
7e5e2588a7
2
nut.pri
2
nut.pri
|
|
@ -14,7 +14,7 @@ HEADERS += \
|
|||
$$PWD/src/generators/sqlservergenerator.h \
|
||||
$$PWD/src/types/dbgeography.h \
|
||||
$$PWD/src/tableset.h \
|
||||
$$PWD/src/defines_p.h \
|
||||
$$PWD/src/defines_consts.h \
|
||||
$$PWD/src/defines.h \
|
||||
$$PWD/src/query.h \
|
||||
$$PWD/src/databasemodel.h \
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#define NUT_NAMESPACE Nut
|
||||
|
||||
#include "defines_p.h"
|
||||
#include "defines_consts.h"
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
|
@ -126,7 +126,7 @@ public slots: \
|
|||
#define NUT_FOREIGN_KEY_IMPLEMENT(class, type, keytype, name, read, write) \
|
||||
Nut::Row<type> class::read() const { return m_##name ; } \
|
||||
void class::write(Nut::Row<type> name){ \
|
||||
propertyChanged(QT_STRINGIFY2(name##Id)); \
|
||||
propertyChanged(QStringLiteral(QT_STRINGIFY2(name##Id))); \
|
||||
m_##name = name; \
|
||||
m_##name##Id = name->primaryValue().value<keytype>(); \
|
||||
} \
|
||||
|
|
@ -136,10 +136,9 @@ public slots: \
|
|||
return m_##name##Id; \
|
||||
} \
|
||||
void class::write##Id(keytype name##Id){ \
|
||||
propertyChanged(QT_STRINGIFY2(name##Id)); \
|
||||
m_##name##Id = name##Id; \
|
||||
m_##name = nullptr; \
|
||||
propertyChanged(QT_STRINGIFY2(name##Id)); \
|
||||
propertyChanged(QStringLiteral(QT_STRINGIFY2(name##Id))); \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ HEADERS += \
|
|||
$$PWD/tablesetbasedata.h \
|
||||
$$PWD/types/dbgeography.h \
|
||||
$$PWD/tableset.h \
|
||||
$$PWD/defines_p.h \
|
||||
$$PWD/defines_consts.h \
|
||||
$$PWD/defines.h \
|
||||
$$PWD/query.h \
|
||||
$$PWD/databasemodel.h \
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ HEADERS += \
|
|||
$$PWD/tablesetbasedata.h \
|
||||
$$PWD/types/dbgeography.h \
|
||||
$$PWD/tableset.h \
|
||||
$$PWD/defines_p.h \
|
||||
$$PWD/defines_consts.h \
|
||||
$$PWD/defines.h \
|
||||
$$PWD/query.h \
|
||||
$$PWD/databasemodel.h \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/QDateTime>
|
||||
#include "table.h"
|
||||
#include <QtNut/table.h>
|
||||
|
||||
#ifdef NUT_NAMESPACE
|
||||
using namespace NUT_NAMESPACE;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
.arg(__func__)
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#define DRIVER "QSQLITE"
|
||||
#define DRIVER QStringLiteral("QSQLITE")
|
||||
#define DATABASE QStringLiteral("/tmp/testdb.sqlite")
|
||||
#define HOST QString()
|
||||
#define USERNAME QString()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
win32 {
|
||||
CONFIG(debug,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/debug)
|
||||
CONFIG(release,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../src/release)
|
||||
CONFIG(debug,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../../src/nut/debug)
|
||||
CONFIG(release,debug|release): LIBDIR = $$absolute_path($$OUT_PWD/../../../src/nut/release)
|
||||
LIBS += -L$$LIBDIR -lnut
|
||||
} else {
|
||||
LIBDIR = $$absolute_path($$OUT_PWD/../../src)
|
||||
LIBDIR = $$absolute_path($$OUT_PWD/../../../lib)
|
||||
android: {
|
||||
|
||||
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
|
||||
|
|
@ -19,11 +19,19 @@ win32 {
|
|||
LIBS += -L$$LIBDIR -lnut_x86_64
|
||||
}
|
||||
} else {
|
||||
LIBS += -L$$LIBDIR -lnut
|
||||
# LIBS += -L$$LIBDIR -lnut
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDEPATH += $$PWD/../../src $$PWD/../common
|
||||
#INCLUDEPATH += $$PWD/../../../src/nut
|
||||
INCLUDEPATH += $$PWD/../common
|
||||
|
||||
QT += nut
|
||||
|
||||
DEFINES += NUT_SHARED_POINTER
|
||||
DEFINES += NUT_PATH=\\\"$$PWD/../../\\\"
|
||||
|
||||
runtarget.target = run-tests
|
||||
runtarget.CONFIG = recursive
|
||||
runtarget.recurse_target = run-tests
|
||||
QMAKE_EXTRA_TARGETS += runtarget
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/QDateTime>
|
||||
#include "table.h"
|
||||
#include "database.h"
|
||||
#include "databasemodel.h"
|
||||
#include <QtNut/table.h>
|
||||
#include <QtNut/database.h>
|
||||
#include <QtNut/databasemodel.h>
|
||||
|
||||
#ifdef NUT_NAMESPACE
|
||||
using namespace NUT_NAMESPACE;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define SCORE_H
|
||||
|
||||
#include <QUuid>
|
||||
#include "table.h"
|
||||
#include <QtNut/table.h>
|
||||
|
||||
class User;
|
||||
class Post;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef USER_H
|
||||
#define USER_H
|
||||
|
||||
#include "table.h"
|
||||
#include "tableset.h"
|
||||
#include <QtNut/table.h>
|
||||
#include <QtNut/tableset.h>
|
||||
|
||||
#include <QtCore/QUuid>
|
||||
#include <QtCore/QString>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef TDATABASE_H
|
||||
#define TDATABASE_H
|
||||
|
||||
#include "database.h"
|
||||
#include <QtNut/database.h>
|
||||
|
||||
#ifdef NUT_NAMESPACE
|
||||
using namespace NUT_NAMESPACE;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
#include "sampletable.h"
|
||||
|
||||
#include "generators/sqlitegenerator.h"
|
||||
#include "generators/sqlservergenerator.h"
|
||||
#include <QtNut/sqlitegenerator.h>
|
||||
#include <QtNut/sqlservergenerator.h>
|
||||
|
||||
DataTypesTest::DataTypesTest(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
#include <QObject>
|
||||
|
||||
#include "tablemodel.h"
|
||||
#include "generators/sqlitegenerator.h"
|
||||
#include "generators/sqlservergenerator.h"
|
||||
#include "generators/mysqlgenerator.h"
|
||||
#include "generators/postgresqlgenerator.h"
|
||||
#include <QtNut/sqlitegenerator.h>
|
||||
#include <QtNut/sqlservergenerator.h>
|
||||
#include <QtNut/mysqlgenerator.h>
|
||||
#include <QtNut/postgresqlgenerator.h>
|
||||
|
||||
#include "tst_generators.h"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue