diff options
Diffstat (limited to 'lang/qt/tests/t-support.cpp')
-rw-r--r-- | lang/qt/tests/t-support.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lang/qt/tests/t-support.cpp b/lang/qt/tests/t-support.cpp index 2444c70f..7b16ccc3 100644 --- a/lang/qt/tests/t-support.cpp +++ b/lang/qt/tests/t-support.cpp @@ -44,6 +44,8 @@ #include <QObject> #include <QDir> +#include "engineinfo.h" + void QGpgMETest::initTestCase() { GpgME::initializeLibrary(); @@ -98,5 +100,21 @@ void killAgent(const QString& dir) proc.waitForFinished(); } +bool loopbackSupported() +{ + /* With GnuPG 2.0.x (at least 2.0.26 by default on jessie) + * the passphrase_cb does not work. So the test popped up + * a pinentry. So tests requiring decryption don't work. */ + static auto version = GpgME::engineInfo(GpgME::GpgEngine).engineVersion(); + if (version < "2.0.0") { + /* With 1.4 it just works */ + return true; + } + if (version < "2.1.0") { + /* With 2.1 it works with loopback mode */ + return false; + } + return true; +} #include "t-support.hmoc" |