qt,tests: Skip WKD lookup tests by default
* lang/qt/tests/t-support.cpp, lang/qt/tests/t-support.h (class QGpgMETest): Add member function doOnlineTests. * lang/qt/tests/t-wkdlookup.cpp (testWKDLookupAsync, testWKDLookupSync, testLookupWithNoResultAsync): Skip tests if online tests are not enabled. -- GnuPG-bug-id: 5728
This commit is contained in:
parent
60880adafa
commit
3a43d9dc67
@ -59,6 +59,12 @@ void QGpgMETest::cleanupTestCase()
|
|||||||
killAgent();
|
killAgent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
bool QGpgMETest::doOnlineTests()
|
||||||
|
{
|
||||||
|
return !qgetenv("DO_ONLINE_TESTS").isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
bool QGpgMETest::copyKeyrings(const QString &src, const QString &dest)
|
bool QGpgMETest::copyKeyrings(const QString &src, const QString &dest)
|
||||||
{
|
{
|
||||||
bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists();
|
bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists();
|
||||||
|
@ -70,6 +70,8 @@ class QGpgMETest : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
protected:
|
protected:
|
||||||
|
static bool doOnlineTests();
|
||||||
|
|
||||||
bool copyKeyrings(const QString &from, const QString& to);
|
bool copyKeyrings(const QString &from, const QString& to);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
@ -75,12 +75,14 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
|
||||||
#ifndef DO_ONLINE_TESTS
|
|
||||||
void testWKDLookupAsync()
|
void testWKDLookupAsync()
|
||||||
{
|
{
|
||||||
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
||||||
QSKIP("dirmngr does not yet support WKD lookup");
|
QSKIP("dirmngr does not yet support WKD lookup");
|
||||||
}
|
}
|
||||||
|
if (!doOnlineTests()) {
|
||||||
|
QSKIP("Set DO_ONLINE_TESTS environment variable to run this test.");
|
||||||
|
}
|
||||||
const QString email = QLatin1String{"wk@gnupg.org"};
|
const QString email = QLatin1String{"wk@gnupg.org"};
|
||||||
|
|
||||||
WKDLookupResult result;
|
WKDLookupResult result;
|
||||||
@ -106,6 +108,9 @@ private Q_SLOTS:
|
|||||||
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
||||||
QSKIP("dirmngr does not yet support WKD lookup");
|
QSKIP("dirmngr does not yet support WKD lookup");
|
||||||
}
|
}
|
||||||
|
if (!doOnlineTests()) {
|
||||||
|
QSKIP("Set DO_ONLINE_TESTS environment variable to run this test.");
|
||||||
|
}
|
||||||
const QString email = QLatin1String{"wk@gnupg.org"};
|
const QString email = QLatin1String{"wk@gnupg.org"};
|
||||||
|
|
||||||
auto *job = openpgp()->wkdLookupJob();
|
auto *job = openpgp()->wkdLookupJob();
|
||||||
@ -123,6 +128,9 @@ private Q_SLOTS:
|
|||||||
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
|
||||||
QSKIP("dirmngr does not yet support WKD lookup");
|
QSKIP("dirmngr does not yet support WKD lookup");
|
||||||
}
|
}
|
||||||
|
if (!doOnlineTests()) {
|
||||||
|
QSKIP("Set DO_ONLINE_TESTS environment variable to run this test.");
|
||||||
|
}
|
||||||
const QString email = QLatin1String{"alfa@example.net"};
|
const QString email = QLatin1String{"alfa@example.net"};
|
||||||
|
|
||||||
WKDLookupResult result;
|
WKDLookupResult result;
|
||||||
@ -140,7 +148,6 @@ private Q_SLOTS:
|
|||||||
QCOMPARE(result.source(), "");
|
QCOMPARE(result.source(), "");
|
||||||
QVERIFY(result.keyData().isNull());
|
QVERIFY(result.keyData().isNull());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QTEST_MAIN(WKDLookupTest)
|
QTEST_MAIN(WKDLookupTest)
|
||||||
|
Loading…
Reference in New Issue
Block a user