[poppler] qt5/tests qt6/tests
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jun 5 16:42:47 UTC 2023
qt5/tests/check_signature_basics.cpp | 22 +++++++++++++++++-----
qt6/tests/check_signature_basics.cpp | 22 +++++++++++++++++-----
2 files changed, 34 insertions(+), 10 deletions(-)
New commits:
commit def45c82b36ec393fbaf16d9873db23bc9659b80
Author: Sune Vuorela <sune at vuorela.dk>
Date: Mon Jun 5 12:36:44 2023 +0200
Don't fail signature basics tests if backend is not configured
diff --git a/qt5/tests/check_signature_basics.cpp b/qt5/tests/check_signature_basics.cpp
index 94aad2f6..635e04c9 100644
--- a/qt5/tests/check_signature_basics.cpp
+++ b/qt5/tests/check_signature_basics.cpp
@@ -58,11 +58,23 @@ void TestSignatureBasics::initTestCase_data()
{
QTest::addColumn<CryptoSign::Backend::Type>("backend");
-#ifdef ENABLE_NSS3
- QTest::newRow("nss") << CryptoSign::Backend::Type::NSS3;
-#endif
-#ifdef ENABLE_GPGME
- QTest::newRow("gpg") << CryptoSign::Backend::Type::GPGME;
+#ifdef ENABLE_SIGNATURES
+ const auto availableBackends = CryptoSign::Factory::getAvailable();
+
+# ifdef ENABLE_NSS3
+ if (std::find(availableBackends.begin(), availableBackends.end(), CryptoSign::Backend::Type::NSS3) != availableBackends.end()) {
+ QTest::newRow("nss") << CryptoSign::Backend::Type::NSS3;
+ } else {
+ QWARN("Compiled with NSS3, but NSS not functional");
+ }
+# endif
+# ifdef ENABLE_GPGME
+ if (std::find(availableBackends.begin(), availableBackends.end(), CryptoSign::Backend::Type::GPGME) != availableBackends.end()) {
+ QTest::newRow("gpg") << CryptoSign::Backend::Type::GPGME;
+ } else {
+ QWARN("Compiled with GPGME, but GPGME not functional");
+ }
+# endif
#endif
}
diff --git a/qt6/tests/check_signature_basics.cpp b/qt6/tests/check_signature_basics.cpp
index 25589e93..9a9955c2 100644
--- a/qt6/tests/check_signature_basics.cpp
+++ b/qt6/tests/check_signature_basics.cpp
@@ -56,11 +56,23 @@ void TestSignatureBasics::initTestCase_data()
{
QTest::addColumn<CryptoSign::Backend::Type>("backend");
-#ifdef ENABLE_NSS3
- QTest::newRow("nss") << CryptoSign::Backend::Type::NSS3;
-#endif
-#ifdef ENABLE_GPGME
- QTest::newRow("gpg") << CryptoSign::Backend::Type::GPGME;
+#ifdef ENABLE_SIGNATURES
+ const auto availableBackends = CryptoSign::Factory::getAvailable();
+
+# ifdef ENABLE_NSS3
+ if (std::find(availableBackends.begin(), availableBackends.end(), CryptoSign::Backend::Type::NSS3) != availableBackends.end()) {
+ QTest::newRow("nss") << CryptoSign::Backend::Type::NSS3;
+ } else {
+ QWARN("Compiled with NSS3, but NSS not functional");
+ }
+# endif
+# ifdef ENABLE_GPGME
+ if (std::find(availableBackends.begin(), availableBackends.end(), CryptoSign::Backend::Type::GPGME) != availableBackends.end()) {
+ QTest::newRow("gpg") << CryptoSign::Backend::Type::GPGME;
+ } else {
+ QWARN("Compiled with GPGME, but GPGME not functional");
+ }
+# endif
#endif
}
More information about the poppler
mailing list