From a509543eb74304813bd88ca7039d1bcd6f69738b Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 24 Jan 2018 16:01:53 +0100 Subject: [PATCH] Fix autotests Remove testing KWallet and GnomeKeyring plugins as I really have no idea how to make it work properly with cmake... --- tests/autotests/CMakeLists.txt | 20 +------ tests/autotests/autotests.pro | 77 ------------------------- tests/autotests/passwordbackendtest.cpp | 46 --------------- tests/autotests/passwordbackendtest.h | 26 --------- 4 files changed, 1 insertion(+), 168 deletions(-) delete mode 100644 tests/autotests/autotests.pro diff --git a/tests/autotests/CMakeLists.txt b/tests/autotests/CMakeLists.txt index 7f493e44f..800dd6727 100644 --- a/tests/autotests/CMakeLists.txt +++ b/tests/autotests/CMakeLists.txt @@ -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) diff --git a/tests/autotests/autotests.pro b/tests/autotests/autotests.pro deleted file mode 100644 index ea1c29c6f..000000000 --- a/tests/autotests/autotests.pro +++ /dev/null @@ -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 \ diff --git a/tests/autotests/passwordbackendtest.cpp b/tests/autotests/passwordbackendtest.cpp index a9f237347..ae6840b84 100644 --- a/tests/autotests/passwordbackendtest.cpp +++ b/tests/autotests/passwordbackendtest.cpp @@ -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 diff --git a/tests/autotests/passwordbackendtest.h b/tests/autotests/passwordbackendtest.h index 58032b2ba..b972130cd 100644 --- a/tests/autotests/passwordbackendtest.h +++ b/tests/autotests/passwordbackendtest.h @@ -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