Skip to content

Commit

Permalink
[qtcontacts-sqlite] Run tests with "make check"
Browse files Browse the repository at this point in the history
Add a "check" target, so that tests can be run uninstalled, with "make
check". In the .pro files, define the TARGET variable before including
the common.pri file, which needs this variable to define the command to
be executed.

In order for the tests to load the plugin, it needs to be moved into a
"contacts" subdirectory; do this with the DESTDIR variable.
  • Loading branch information
mardy committed Nov 13, 2017
1 parent 3f3577e commit 88b2aeb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/engine/engine.pro
Expand Up @@ -7,6 +7,7 @@ QT += sql dbus

CONFIG += plugin hide_symbols
PLUGIN_TYPE=contacts
DESTDIR=$${PLUGIN_TYPE}

# we hardcode this for Qt4 as there's no GenericDataLocation offered by QDesktopServices
DEFINES += 'QTCONTACTS_SQLITE_PRIVILEGED_DIR=\'\"privileged\"\''
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/database/database.pro
@@ -1,7 +1,7 @@
include(../../common.pri)

TARGET = tst_database

include(../../common.pri)

QT += sql

# copied from src/engine/engine.pro, modified for test db
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/memorytable/memorytable.pro
@@ -1,7 +1,7 @@
include(../../common.pri)

TARGET = tst_memorytable

include(../../common.pri)

HEADERS += \
../../util.h
SOURCES += \
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/phonenumber/phonenumber.pro
@@ -1,7 +1,7 @@
include(../../common.pri)

TARGET = tst_phonenumber

include(../../common.pri)

HEADERS += \
../../util.h
SOURCES += \
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/qcontactmanager/qcontactmanager.pro
@@ -1,7 +1,7 @@
include(../../common.pri)

TARGET = tst_qcontactmanager

include(../../common.pri)

INCLUDEPATH += \
../../../src/engine/

Expand Down
@@ -1,7 +1,7 @@
include(../../common.pri)

TARGET = tst_qcontactmanagerfiltering

include(../../common.pri)

INCLUDEPATH += \
../../../src/engine/

Expand Down
4 changes: 4 additions & 0 deletions tests/common.pri
Expand Up @@ -8,3 +8,7 @@ INCLUDEPATH += $$PWD/../src/extensions

target.path = /opt/tests/qtcontacts-sqlite-qt5
INSTALLS += target

check.commands = "LC_ALL=C QT_PLUGIN_PATH=$$shadowed($${PWD})/../src/engine/ ./$${TARGET}"
check.depends = $${TARGET}
QMAKE_EXTRA_TARGETS += check

0 comments on commit 88b2aeb

Please sign in to comment.