Commit ee2326ce authored by Adrián Chaves's avatar Adrián Chaves

Allow running SQLite test without previously installing the library

parent 3a6e0d90
# ‘dbschema.sql’ installation.
# ${DATA_INSTALL_DIR} is defined in ‘CMakeLists.txt’ (in root directory).
install(FILES dbschema.sql DESTINATION ${DATA_INSTALL_DIR})
set(SCHEMA_FILENAME "dbschema.sql")
install(FILES ${SCHEMA_FILENAME} DESTINATION ${DATA_INSTALL_DIR})
configure_file(${SCHEMA_FILENAME} ${SCHEMA_FILENAME} COPYONLY)
......@@ -9,13 +9,15 @@
*/
#include "akabeisqlitetest.h"
#include <QCoreApplication>
#include <QDebug>
#include <QTemporaryFile>
#include <QTest>
#include "SQLiteConnection.h"
#include <qtemporaryfile.h>
#include "akabeicoreconfig.h"
#include "akabeipackage.h"
#include <akabeiquery.h>
#include <QDebug>
#include "akabeiquery.h"
#include "SQLiteConnection.h"
AkabeiSQLiteTest::AkabeiSQLiteTest(QObject * parent) : QObject(parent)
{
......@@ -34,6 +36,8 @@ void AkabeiSQLiteTest::test()
file.close();
SQLiteConnection c(file.fileName(), false);
QString DB_SCHEMA(QCoreApplication::applicationDirPath() +
QStringLiteral("/../../etc/dbschema.sql"));
QFile schemaFile(DB_SCHEMA);
QVERIFY(schemaFile.open(QIODevice::ReadOnly | QIODevice::Text));
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment