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

[Autotests] Correctly link to KDE/Gnome password plugins

Also make PACTest pass by fixing qupzilla.com IP.
This commit is contained in:
nowrep 2014-02-01 17:22:55 +01:00
parent 91f0c40691
commit 865fd034a3
5 changed files with 27 additions and 14 deletions

View File

@ -10,17 +10,23 @@ TARGET = autotests
!unix|mac: LIBS += -L$$PWD/../../bin -lQupZilla
!mac:unix: LIBS += $$PWD/../../bin/libQupZilla.so
# Link plugins for PasswordBackends
!win32 {
!unix|mac: LIBS += -L$$PWD/../../bin/plugins -lGnomeKeyringPasswords -lKWalletPasswords
!mac:unix: LIBS += $$PWD/../../bin/plugins/libGnomeKeyringPasswords.so \
$$PWD/../../bin/plugins/libKWalletPasswords.so
}
unix:contains(DEFINES, "NO_SYSTEM_DATAPATH"): QMAKE_LFLAGS+=$${QMAKE_LFLAGS_RPATH}\\$\$ORIGIN
include($$PWD/../../src/defines.pri)
# 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
}
DESTDIR = $$PWD/../../bin
OBJECTS_DIR = build
MOC_DIR = build

View File

@ -49,8 +49,12 @@ int main(int argc, char *argv[])
RUN_TEST(DatabasePasswordBackendTest)
RUN_TEST(DatabaseEncryptedPasswordBackendTest)
#ifndef Q_OS_WIN
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
RUN_TEST(KWalletPasswordBackendTest)
#endif
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
RUN_TEST(GnomeKeyringPasswordBackendTest)
#endif

View File

@ -135,9 +135,9 @@ void PacTest::isInNetTest_data()
QTest::newRow("doc2-3") << "128.94.249.79" << "198.95.0.0" << "255.255.0.0" << false;
QTest::newRow("doc2-3") << "23.94.249.79" << "198.95.0.0" << "255.255.0.0" << false;
// is true if the IP address of host matches 88.208.118.* (qupzilla.com)
// is true if the IP address of host matches 85.118.128.* (qupzilla.com)
// if host is passed as hostname, the function needs to resolve it
QTest::newRow("resolve1") << "qupzilla.com" << "88.208.118.158" << "255.255.255.0" << true;
QTest::newRow("resolve1") << "qupzilla.com" << "85.118.128.38" << "255.255.255.0" << true;
QTest::newRow("resolve1-2") << "yahoo.com" << "173.194.70.0" << "255.255.255.0" << false;
QTest::newRow("resolve1-3") << "netscape.com" << "173.194.70.0" << "255.255.255.0" << false;
QTest::newRow("resolve1-4") << "mozilla.com" << "173.194.70.0" << "255.255.255.0" << false;
@ -160,7 +160,7 @@ void PacTest::dnsResolveTest_data()
QTest::addColumn<QString>("result");
QTest::newRow("localhost") << "localhost" << "127.0.0.1";
QTest::newRow("qz") << "qupzilla.com" << "88.208.118.158"; // This may change...
QTest::newRow("qz") << "qupzilla.com" << "85.118.128.38"; // This may change...
}
void PacTest::dnsResolveTest()

View File

@ -267,15 +267,16 @@ void DatabaseEncryptedPasswordBackendTest::cleanup()
QSqlDatabase::removeDatabase(QSqlDatabase::database().databaseName());
}
#ifndef Q_OS_WIN
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
// KWalletPassswordBackendTest
void KWalletPasswordBackendTest::reloadBackend()
{
delete m_backend;
m_backend = new KWalletPasswordBackend;
}
#endif
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
// GnomeKeyringPassswordBackendTest
void GnomeKeyringPasswordBackendTest::reloadBackend()
{

View File

@ -75,7 +75,7 @@ protected:
void cleanup();
};
#ifndef Q_OS_WIN
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
#include "../../src/plugins/KWalletPasswords/kwalletpasswordbackend.h"
class KWalletPasswordBackendTest : public PasswordBackendTest
@ -85,7 +85,9 @@ class KWalletPasswordBackendTest : public PasswordBackendTest
protected:
void reloadBackend();
};
#endif
#ifdef HAVE_GNOME_PASSWORDS_PLUGIN
#include "../../src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.h"
class GnomeKeyringPasswordBackendTest : public PasswordBackendTest