aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2021-12-14 10:04:03 +0000
committerIngo Klöcker <[email protected]>2021-12-14 10:04:03 +0000
commit3a43d9dc67970db323c3e49eb964d52c4eb3ac6c (patch)
treec6afd9a747334ac8361396168b01262125f20e3d
parentcore: Allow specifiying a key origin when importing keys (diff)
downloadgpgme-3a43d9dc67970db323c3e49eb964d52c4eb3ac6c.tar.gz
gpgme-3a43d9dc67970db323c3e49eb964d52c4eb3ac6c.zip
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
-rw-r--r--lang/qt/tests/t-support.cpp6
-rw-r--r--lang/qt/tests/t-support.h2
-rw-r--r--lang/qt/tests/t-wkdlookup.cpp11
3 files changed, 17 insertions, 2 deletions
diff --git a/lang/qt/tests/t-support.cpp b/lang/qt/tests/t-support.cpp
index 7b16ccc3..854dd7bd 100644
--- a/lang/qt/tests/t-support.cpp
+++ b/lang/qt/tests/t-support.cpp
@@ -59,6 +59,12 @@ void QGpgMETest::cleanupTestCase()
killAgent();
}
+// static
+bool QGpgMETest::doOnlineTests()
+{
+ return !qgetenv("DO_ONLINE_TESTS").isEmpty();
+}
+
bool QGpgMETest::copyKeyrings(const QString &src, const QString &dest)
{
bool is21dir = QFileInfo(src + QDir::separator() + QStringLiteral("pubring.kbx")).exists();
diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h
index 22ba473c..8435de5b 100644
--- a/lang/qt/tests/t-support.h
+++ b/lang/qt/tests/t-support.h
@@ -70,6 +70,8 @@ class QGpgMETest : public QObject
{
Q_OBJECT
protected:
+ static bool doOnlineTests();
+
bool copyKeyrings(const QString &from, const QString& to);
public Q_SLOTS:
diff --git a/lang/qt/tests/t-wkdlookup.cpp b/lang/qt/tests/t-wkdlookup.cpp
index 13c70269..0fbe67a2 100644
--- a/lang/qt/tests/t-wkdlookup.cpp
+++ b/lang/qt/tests/t-wkdlookup.cpp
@@ -75,12 +75,14 @@ Q_SIGNALS:
private Q_SLOTS:
-#ifndef DO_ONLINE_TESTS
void testWKDLookupAsync()
{
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
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{"[email protected]"};
WKDLookupResult result;
@@ -106,6 +108,9 @@ private Q_SLOTS:
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
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{"[email protected]"};
auto *job = openpgp()->wkdLookupJob();
@@ -123,6 +128,9 @@ private Q_SLOTS:
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < requiredVersion) {
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{"[email protected]"};
WKDLookupResult result;
@@ -140,7 +148,6 @@ private Q_SLOTS:
QCOMPARE(result.source(), "");
QVERIFY(result.keyData().isNull());
}
-#endif
};
QTEST_MAIN(WKDLookupTest)