[gmime] Disable PGP tests if crypto is not enabled.



commit 28d4f9353506507c9acf343a6e259a33cb12c13e
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date:   Tue Mar 14 07:58:52 2017 -0400

    Disable PGP tests if crypto is not enabled.

 tests/test-pgp.c     |    5 +++++
 tests/test-pgpmime.c |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-pgp.c b/tests/test-pgp.c
index e82b40e..5eadc41 100644
--- a/tests/test-pgp.c
+++ b/tests/test-pgp.c
@@ -332,6 +332,7 @@ import_key (GMimeCryptoContext *ctx, const char *path)
 
 int main (int argc, char **argv)
 {
+#ifdef ENABLE_CRYPTO
        const char *datadir = "data/pgp";
        GMimeStream *istream, *ostream;
        GMimeCryptoContext *ctx;
@@ -489,4 +490,8 @@ int main (int argc, char **argv)
                return EXIT_FAILURE;
        
        return testsuite_exit ();
+#else
+       fprintf (stderr, "PGP support not enabled in this build.\n");
+       return EXIT_SUCCESS;
+#endif
 }
diff --git a/tests/test-pgpmime.c b/tests/test-pgpmime.c
index 5d92430..56f67a8 100644
--- a/tests/test-pgpmime.c
+++ b/tests/test-pgpmime.c
@@ -450,6 +450,7 @@ import_key (GMimeCryptoContext *ctx, const char *path)
 
 int main (int argc, char *argv[])
 {
+#ifdef ENABLE_CRYPTO
        GMimeStream *stream = NULL, *cleartext = NULL;
        const char *datadir = "data/pgpmime";
        char *session_key = NULL;
@@ -572,4 +573,8 @@ int main (int argc, char *argv[])
                return EXIT_FAILURE;
        
        return testsuite_exit ();
+#else
+       fprintf (stderr, "PGP support not enabled in this build.\n");
+       return EXIT_SUCCESS;
+#endif
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]