1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Fix autotests

Remove testing KWallet and GnomeKeyring plugins as I really
have no idea how to make it work properly with cmake...
This commit is contained in:
David Rosca 2018-01-24 16:01:53 +01:00
parent bdd18ced1e
commit a509543eb7
4 changed files with 1 additions and 168 deletions

View File

@ -1,21 +1,3 @@
set(autotests_EXTRA_LIBS )
if (KF5Wallet_FOUND)
add_definitions(-DHAVE_KDE_PASSWORDS_PLUGIN)
add_library(KWalletPasswordsPluginLib UNKNOWN IMPORTED)
set_property(TARGET KWalletPasswordsPluginLib PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/bin/plugins/KWalletPasswords.so)
add_dependencies(KWalletPasswordsPluginLib KWalletPasswords)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} KWalletPasswordsPluginLib)
endif()
if (GNOME_KEYRING_FOUND)
add_definitions(-DHAVE_GNOME_PASSWORDS_PLUGIN)
add_library(GnomeKeyringPasswordsPluginLib UNKNOWN IMPORTED)
set_property(TARGET GnomeKeyringPasswordsPluginLib PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/bin/plugins/GnomeKeyringPasswords.so)
add_dependencies(GnomeKeyringPasswordsPluginLib GnomeKeyringPasswords)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} GnomeKeyringPasswordsPluginLib)
endif()
set( autotests_SRCS
qztoolstest.cpp
main.cpp
@ -26,4 +8,4 @@ set( autotests_SRCS
)
add_executable(autotests ${autotests_SRCS})
target_link_libraries(autotests FalkonPrivate Qt5::Test ${autotests_EXTRA_LIBS})
target_link_libraries(autotests FalkonPrivate Qt5::Test)

View File

@ -1,77 +0,0 @@
include($$PWD/../../src/defines.pri)
QT += webenginewidgets network widgets printsupport sql script dbus testlib
TARGET = autotests
CONFIG -= app_bundle
!unix|mac: LIBS += -L$$PWD/../../bin -lFalkon
!mac:unix: LIBS += $$PWD/../../bin/libFalkon.so
QMAKE_LFLAGS+=$${QMAKE_LFLAGS_RPATH}$$PWD/../../bin
# KWallet plugin
exists($$PWD/../../bin/plugins/libKWalletPasswords.so) {
LIBS += $$PWD/../../bin/plugins/libKWalletPasswords.so
DEFINES += HAVE_KDE_PASSWORDS_PLUGIN
}
# GnomeKeyring plugin
exists($$PWD/../../bin/plugins/libGnomeKeyringPasswords.so) {
LIBS += $$PWD/../../bin/plugins/libGnomeKeyringPasswords.so
DEFINES += HAVE_GNOME_PASSWORDS_PLUGIN
}
mac {
# homebrew openssl
BREW_OPENSSL = $$system("brew --prefix openssl")
INCLUDEPATH += $$BREW_OPENSSL/include
LIBS += -L$$BREW_OPENSSL/lib
LIBS += -lcrypto -framework CoreServices
}
DESTDIR =
OBJECTS_DIR = build
MOC_DIR = build
RCC_DIR = build
UI_DIR = build
INCLUDEPATH += $$PWD/../../src/lib/3rdparty \
$$PWD/../../src/lib/adblock \
$$PWD/../../src/lib/app \
$$PWD/../../src/lib/autofill \
$$PWD/../../src/lib/bookmarks \
$$PWD/../../src/lib/cookies \
$$PWD/../../src/lib/downloads \
$$PWD/../../src/lib/history \
$$PWD/../../src/lib/navigation \
$$PWD/../../src/lib/network \
$$PWD/../../src/lib/notifications \
$$PWD/../../src/lib/opensearch \
$$PWD/../../src/lib/other \
$$PWD/../../src/lib/plugins \
$$PWD/../../src/lib/popupwindow \
$$PWD/../../src/lib/preferences \
$$PWD/../../src/lib/session \
$$PWD/../../src/lib/sidebar \
$$PWD/../../src/lib/tabwidget \
$$PWD/../../src/lib/tools \
$$PWD/../../src/lib/webengine \
$$PWD/../../src/lib/webtab \
HEADERS += \
qztoolstest.h \
cookiestest.h \
adblocktest.h \
updatertest.h \
passwordbackendtest.h \
SOURCES += \
qztoolstest.cpp \
main.cpp \
cookiestest.cpp \
adblocktest.cpp \
updatertest.cpp \
passwordbackendtest.cpp \

View File

@ -271,49 +271,3 @@ void DatabaseEncryptedPasswordBackendTest::cleanup()
{
QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName());
}
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
// KWalletPassswordBackendTest
void KWalletPasswordBackendTest::init()
{
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("/org/freedesktop/DBus"),
QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("StartServiceByName"));
msg << "org.kde.kwalletd5";
msg << quint32(0);
QDBusMessage reply = QDBusConnection::sessionBus().call(msg);
if (reply.arguments().isEmpty() || reply.arguments().constFirst().toInt() != 1)
QSKIP("This test requires org.kde.kwalletd5 service.");
}
void KWalletPasswordBackendTest::reloadBackend()
{
delete m_backend;
m_backend = new KWalletPasswordBackend;
}
#endif
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
// GnomeKeyringPassswordBackendTest
void GnomeKeyringPasswordBackendTest::init()
{
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("/org/freedesktop/DBus"),
QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("StartServiceByName"));
msg << "org.freedesktop.secrets";
msg << quint32(0);
QDBusMessage reply = QDBusConnection::sessionBus().call(msg);
if (reply.arguments().isEmpty() || reply.arguments().constFirst().toInt() != 1)
QSKIP("This test requires org.freedesktop.secrets service.");
}
void GnomeKeyringPasswordBackendTest::reloadBackend()
{
delete m_backend;
m_backend = new GnomeKeyringPasswordBackend;
}
#endif

View File

@ -75,30 +75,4 @@ protected:
void cleanup();
};
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
#include "../../src/plugins/KWalletPasswords/kwalletpasswordbackend.h"
class KWalletPasswordBackendTest : public PasswordBackendTest
{
Q_OBJECT
protected:
void init();
void reloadBackend();
};
#endif
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
#include "../../src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.h"
class GnomeKeyringPasswordBackendTest : public PasswordBackendTest
{
Q_OBJECT
protected:
void init();
void reloadBackend();
};
#endif
#endif // PASSWORDBACKENDTEST_H